Nice
I couldn't do that, simply because I am restricted to procedural APIs: the devmode module DLL cannot use classes of the mother executable.
For me, there's also a question of performance, any logging has to be wrapped into
if Verbose then AddLog(...)
because sometimes I stick logging in time-sensitive areas.
If I do simple
VerboseLog()
instead, which checks conditions on its own, that's still a lot of passing around strings, "array of const", maybe IntToHex here and here - and hello, slowdown.
So as I do that anyway, I just upgraded from
if Mother^.Debug.Verbose
to
if Verbose(<condition>)
, which simply checks an enum against a set.
for example,
Code:if Verbose(vla_Chepersy) then AddLog( 'Freezing the database state, the memory manager has %0Mb committed' + ' in %1 blocks' ,[Cps.MemoryManager.TotalAllocatedSysMem div (1024 * 1024), Cps.MemoryManager.NumBlocks]); MOVE(chepersy.Cps, SavedChepersyState, sizeof(chepersy.Cps)); FillChar(chepersy.Cps, sizeof(chepersy.Cps), 0); // NO deinit!
But! More importantly, I finally found a good alternative to LGPL, which I used since the very beginning in 2006, and switched my engine to MPL 2.0
It allows what I am aiming for (static linking with map scripts of questionable reputability auto-converted from the ACS language to Pascal) while still allowing to use my code in a GPL project if someone so wishes.
Turns out I had accumulated lot of third party code, with a zoo of different licenses, all of that had to be reviewed and addressed.
Chentrah
Copyright (C) 2002-2021 ChebMaster (user5543@chebmaster.com)
The source code is covered by following licenses:
The OpenGL and OpenGL ES 2.0 headers
under SGI Free Software License B
The JEDI DirectSound headers
under dual MPL 1.1 and LGPL
The Broadcom library headers (c) 2012, Broadcom Europe Ltd
under custom free permission
- see un_gles_raspberry_pi.h
The Vampyre Imaging library
(see the 3rdparty folder)
under dual MPL 1.1 and LGPL
The modified part of paszlib (un_unzip.pp)
under custom free permission
- see LICENSE-paszlib.txt
The modified parts of Free Pascal RTL (various parsers of debugging info)
under modified LGPL 2.1 allowing linking into executables regardless of license
- see LICENSE-FPC.txt
The rest of the engine
under MPL 2.0 - which allows use under GPL/LGPL 2.1 or later
If some source file does not contain license information
it means I forgot to embed the MPL2.0 notice.
Poke me with a stick.
Please see how I handled a dwarf parser unit borrowed from RTL and tell me I didn't do it wrong
Code:{ Modified by ChebMaster in 2018 to integrate into Chentrah This file is part of the Free Pascal run time library. Copyright (c) 2006 by Thomas Schatzl, member of the FreePascal Development team Parts (c) 2000 Peter Vreman (adapted from original dwarfs line reader) Dwarf LineInfo Retriever See the file LICENSE-FPC.txt, included in this distribution, for details about the copyright. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************}This is the file LICENSE-FPC.txt, it applies to modified fragments of
the Free Pascal Run-Time Library (RTL)
distributed by ChebMaster (user5543@chebmaster.com).
The source code of the Free Pascal Runtime Libraries and packages are
distributed under the Library GNU General Public License
(see the file LICENSE-LGPLv2.txt) with the following modification:
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent modules,
and to copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the terms
and conditions of the license of that module. An independent module is a module
which is not derived from or based on this library. If you modify this
library, you may extend this exception to your version of the library, but you are
not obligated to do so. If you do not wish to do so, delete this exception
statement from your version.
If you didn't receive a copy of the file LICENSE-LGPLv2.txt, contact:
Free Software Foundation
675 Mass Ave
Cambridge, MA 02139
USA
Bookmarks