Conditional defines in Delphi are limited to 255 characters. That means that if you have more than 255 characters of defines, they are ignored. E.g.
So the set of conditional defines:
Win32API;AlarmServerEngineVersion27;ImNotUsingOlderSimpleThread;EnableJclExceptionTracking;SaveExceptionsToDatabase;ShowExceptionForm;SNAPIN_NEEDS_NODE_DESCRIPTOR;VIRTUAL_TREES_MOUSE_DOWN_FOCUS_LAST;UseSQLServerLocking;SnapInFactoryFormClassIsOptional;Strict;SIFFCIO;Sqm
The last 3 defines are ignored.
What i need is a way to define conditional defines in the project, while not being limited to 255 characters.
i thought maybe moving the conditional defines to the project source file, perhaps included through in include file:
program ConsotoManager;
{$R *.RES}
{$R '..\Resource\Wumpa.res' '..\Resource\Wumpa.rc'}
{$DEFINE Win32API}
...
{$DEFINE Sqm}
{$DEFINE Strict}
uses
FastMM4,
Windows,
SysUtils,
Unfortunately it doesnt' work. The reason it doesn't work is that you cannot substitute defines for conditional defines; defines only last until the end of the file.
So, how do i overcome the 255 character limit on Conditional Defines in Delphi?
The problem, of course, is how to have project level defines, while have shared source code files (shared files are in their own directories, outside of the project folder).
{$INCLUDE Defines.inc}
to the top ofVirtualTrees.pas
, it won't work because it won't be able to findDefines.inc
(sinceDefines.inc
is sitting in my project's source folder. And even if it did work, i would introduce a breaking change to the library, as none of the other projects will have thisDefines.inc
file. – Cirro