-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathIdCompilerDefines.inc
1740 lines (1592 loc) · 44.3 KB
/
IdCompilerDefines.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{$IFDEF CONDITIONALEXPRESSIONS}
// Must be at the top...
{$IF CompilerVersion >= 24.0}
{$LEGACYIFEND ON}
{$IFEND}
{$ENDIF}
// General
// Make this $DEFINE to use the 16 color icons required by Borland
// or DEFINE to use the 256 color Indy versions
{.$DEFINE Borland}
// S.G. 4/9/2002: IPv4/IPv6 general switch (for defaults only)
{$DEFINE IdIPv4} // use IPv4 by default
{.$IFDEF IdIPv6} // use IPv6 by default
{$DEFINE INDY100}
{$DEFINE 10_6_2} //so developers can IFDEF for this specific version
// When generating C++Builder output files, certain workarounds to compiler
// problems need to be enabled! When invoking DCC on the command-line, use
// the -DBCB parameter. When invoking MSBUILD, include the DCC_Define="BCB"
// attribute in the /p parameter.
{$IFDEF BCB}
{$DEFINE CBUILDER}
{$ELSE}
{$DEFINE DELPHI}
{$ENDIF}
{$UNDEF USE_OPENSSL}
{$UNDEF STATICLOAD_OPENSSL}
{$UNDEF USE_ZLIB_UNIT}
{$UNDEF USE_SSPI}
// $DEFINE the following if the global objects in the IdStack and IdThread
// units should be freed on finalization
{.$DEFINE FREE_ON_FINAL}
{$UNDEF FREE_ON_FINAL}
// Make sure the following is $DEFINE'd only for suitable environments
// as specified further below. This works in conjunction with the
// FREE_ON_FINAL define above.
{$UNDEF REGISTER_EXPECTED_MEMORY_LEAK}
// FastMM is natively available in BDS 2006 and higher. $DEFINE the
// following if FastMM has been installed manually in earlier versions
{.$DEFINE USE_FASTMM4}
{$UNDEF USE_FASTMM4}
// $DEFINE the following if MadExcept has been installed manually in
// BDS 2005 or earlier (System.RegisterExpectedMemoryLeak() was introduced
// in BDS 2006)
{.$DEFINE USE_MADEXCEPT}
{$UNDEF USE_MADEXCEPT}
// Make sure the following are $DEFINE'd only for Delphi/C++Builder 2009 onwards
// as specified further below. The VCL is fully Unicode, where the 'String'
// type maps to System.UnicodeString, not System.AnsiString anymore
{$UNDEF STRING_IS_UNICODE}
{$UNDEF STRING_IS_ANSI}
{$UNDEF STRING_UNICODE_MISMATCH}
// Make sure the following are $DEFINE'd only for suitable environments
// as specified further below. Delphi/C++Builder Mobile/NextGen compilers
// do not support Ansi data types anymore, and is moving away from raw
// pointers as well.
{$DEFINE HAS_AnsiString}
{$DEFINE HAS_AnsiChar}
{$DEFINE HAS_PAnsiChar}
{$UNDEF HAS_PPAnsiChar}
{$UNDEF NO_ANSI_TYPES}
{$UNDEF USE_MARSHALLED_PTRS}
{$UNDEF HAS_MarshaledAString}
{$UNDEF USE_OBJECT_ARC}
// Make sure the following is $DEFINE'd only for suitable environments
// as specified further below.
{$UNDEF STRING_IS_IMMUTABLE}
{$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
// Make sure the following are $DEFINE'd only for suitable environments
// as specified further below.
{$UNDEF HAS_TEncoding}
{$UNDEF HAS_TEncoding_GetEncoding_ByEncodingName}
{$UNDEF HAS_Exception_RaiseOuterException}
{$UNDEF HAS_System_ReturnAddress}
{$UNDEF HAS_TCharacter}
{$UNDEF HAS_TInterlocked}
{$UNDEF HAS_TNetEncoding}
// Make sure that this is defined only for environments where we are using
// the iconv library to charactor conversions.
{.$UNDEF USE_ICONV}
//Define for Delphi cross-compiler targetting Posix
{$UNDEF USE_VCL_POSIX}
{$UNDEF HAS_ComponentPlatformsAttribute}
{$UNDEF HAS_ComponentPlatformsAttribute_Win32}
{$UNDEF HAS_ComponentPlatformsAttribute_Win64}
{$UNDEF HAS_ComponentPlatformsAttribute_OSX32}
{$UNDEF HAS_ComponentPlatformsAttribute_iOS_Simulator}
{$UNDEF HAS_ComponentPlatformsAttribute_Android}
{$UNDEF HAS_ComponentPlatformsAttribute_Linux32}
{$UNDEF HAS_ComponentPlatformsAttribute_iOS_Device}
{$UNDEF HAS_ComponentPlatformsAttribute_iOS_Device32}
{$UNDEF HAS_ComponentPlatformsAttribute_Linux64}
{$UNDEF HAS_ComponentPlatformsAttribute_WinNX32}
{$UNDEF HAS_ComponentPlatformsAttribute_WinIoT32}
{$UNDEF HAS_ComponentPlatformsAttribute_iOS_Device64}
{$UNDEF HAS_DIRECTIVE_WARN_DEFAULT}
// Define for Delphi to auto-generate platform-appropriate '#pragma link' statements in HPP files
{$UNDEF HAS_DIRECTIVE_HPPEMIT_LINKUNIT}
// detect compiler versions
// TODO: to detect features in Delphi/C++Builder v6 and later, use CompilerVersion
// and RTLVersion constants instead of VERXXX defines. We still support v5, which
// does not have such constants.
// Delphi 4
{$IFDEF VER120}
{$DEFINE DCC}
{$DEFINE VCL_40}
{$DEFINE DELPHI_4}
{$ENDIF}
// C++Builder 4
{$IFDEF VER125}
{$DEFINE DCC}
{$DEFINE VCL_40}
{$DEFINE CBUILDER_4}
{$ENDIF}
// Delphi & C++Builder 5
{$IFDEF VER130}
{$DEFINE DCC}
{$DEFINE VCL_50}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_5}
{$ELSE}
{$DEFINE DELPHI_5}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 6
{$IFDEF VER140}
{$DEFINE DCC}
{$DEFINE VCL_60}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_6}
{$ELSE}
{$DEFINE DELPHI_6}
{$ENDIF}
{$ENDIF}
//Delphi 7
{$IFDEF VER150}
{$DEFINE DCC}
{$DEFINE VCL_70}
{$DEFINE DELPHI_7} // there was no C++ Builder 7
{$ENDIF}
//Delphi 8
{$IFDEF VER160}
{$DEFINE DCC}
{$DEFINE VCL_80}
{$DEFINE DELPHI_8} // there was no C++ Builder 8
{$ENDIF}
//Delphi 2005
{$IFDEF VER170}
{$DEFINE DCC}
{$DEFINE VCL_2005}
{$DEFINE DELPHI_2005} // there was no C++Builder 2005
{$ENDIF}
// NOTE: CodeGear decided to make Highlander be a non-breaking release
// (no interface changes, thus fully backwards compatible without any
// end user code changes), so VER180 applies to both BDS 2006 and
// Highlander prior to the release of RAD Studio 2007. Use VER185 to
// identify Highlanger specifically.
//Delphi & C++Builder 2006
//Delphi & C++Builder 2007 (Highlander)
{$IFDEF VER180}
{$DEFINE DCC}
{$DEFINE VCL_2006}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_2006}
{$ELSE}
{$DEFINE DELPHI_2006}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 2007 (Highlander)
{$IFDEF VER185}
{$DEFINE DCC}
{$UNDEF VCL_2006}
{$DEFINE VCL_2007}
{$IFDEF CBUILDER}
{$UNDEF CBUILDER_2006}
{$DEFINE CBUILDER_2007}
{$ELSE}
{$UNDEF DELPHI_2006}
{$DEFINE DELPHI_2007}
{$ENDIF}
{$ENDIF}
// BDS 2007 NET personality uses VER190 instead of 185.
//Delphi .NET 2007
{$IFDEF VER190}
{$DEFINE DCC}
{$IFDEF CIL}
//Delphi 2007
{$DEFINE VCL_2007}
{$DEFINE DELPHI_2007}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 2009 (Tiburon)
{$IFDEF VER200}
{$DEFINE DCC}
{$DEFINE VCL_2009}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_2009}
{$ELSE}
{$DEFINE DELPHI_2009}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 2010 (Weaver)
{$IFDEF VER210}
{$DEFINE DCC}
{$DEFINE VCL_2010}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_2010}
{$ELSE}
{$DEFINE DELPHI_2010}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder XE (Fulcrum)
{$IFDEF VER220}
//REMOVE DCC DEFINE after the next Fulcrum beta.
//It will be defined there.
{$IFNDEF DCC}
{$DEFINE DCC}
{$ENDIF}
{$DEFINE VCL_XE}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE}
{$ELSE}
{$DEFINE DELPHI_XE}
{$ENDIF}
{$ENDIF}
// DCC is now defined by the Delphi compiler starting in XE2
//Delphi & CBuilder XE2 (Pulsar)
{$IFDEF VER230}
{$DEFINE VCL_XE2}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE2}
{$ELSE}
{$DEFINE DELPHI_XE2}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE3 (Waterdragon)
//Delphi & CBuilder XE3.5 (Quintessence - early betas only)
{$IFDEF VER240}
{$DEFINE VCL_XE3}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE3}
{$ELSE}
{$DEFINE DELPHI_XE3}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE4 (Quintessence)
{$IFDEF VER250}
{$UNDEF VCL_XE3}
{$DEFINE VCL_XE4}
{$IFDEF CBUILDER}
{$UNDEF CBUILDER_XE3}
{$DEFINE CBUILDER_XE4}
{$ELSE}
{$UNDEF DELPHI_XE3}
{$DEFINE DELPHI_XE4}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE5 (Zephyr)
{$IFDEF VER260}
{$DEFINE VCL_XE5}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE5}
{$ELSE}
{$DEFINE DELPHI_XE5}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder AppMethod
//AppMethod is just XE5 for mobile only, VCL is removed
{$IFDEF VER265}
{$DEFINE VCL_XE5}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE5}
{$ELSE}
{$DEFINE DELPHI_XE5}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE6 (Proteus)
{$IFDEF VER270}
{$DEFINE VCL_XE6}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE6}
{$ELSE}
{$DEFINE DELPHI_XE6}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE7 (Carpathia)
{$IFDEF VER280}
{$DEFINE VCL_XE7}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE7}
{$ELSE}
{$DEFINE DELPHI_XE7}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE8 (Elbrus)
{$IFDEF VER290}
{$DEFINE VCL_XE8}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE8}
{$ELSE}
{$DEFINE DELPHI_XE8}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.0 Seattle (Aitana)
{$IFDEF VER300}
{$DEFINE VCL_10_0_SEATTLE}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_VCL_10_0_SEATTLE}
{$ELSE}
{$DEFINE DELPHI_VCL_10_0_SEATTLE}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.1 Berlin (BigBen)
{$IFDEF VER310}
{$DEFINE VCL_10_1_BERLIN}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_10_1_BERLIN}
{$ELSE}
{$DEFINE DELPHI_10_1_BERLIN}
{$ENDIF}
{$ENDIF}
// Delphi.NET
// Covers D8+
{$IFDEF CIL}
// Platform specific conditional. Used for platform specific code.
{$DEFINE DOTNET}
{$DEFINE STRING_IS_UNICODE}
{$DEFINE STRING_IS_IMMUTABLE}
{.$DEFINE HAS_Int8}
{.$DEFINE HAS_UInt8}
{$DEFINE HAS_Int16}
{$DEFINE HAS_UInt16}
{$DEFINE HAS_Int32}
{$DEFINE HAS_UInt32}
{$DEFINE HAS_UInt64}
{$ENDIF}
// Kylix
//
//Important: Don't use CompilerVersion here as IF's are evaluated before
//IFDEF's and Kylix 1 does not have CompilerVersion defined at all.
{$IFNDEF FPC}
{$IFDEF LINUX}
{$DEFINE UNIX}
{$IFDEF CONDITIONALEXPRESSIONS}
{$IF (RTLVersion >= 14.0) and (RTLVersion <= 14.5) }
{$DEFINE KYLIX}
{$IF RTLVersion = 14.5}
{$DEFINE KYLIX_3}
{$ELSEIF RTLVersion >= 14.2}
{$DEFINE KYLIX_2}
{$ELSE}
{$DEFINE KYLIX_1}
{$IFEND}
{$IFEND}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$IFDEF KYLIX}
{$DEFINE VCL_60}
{$DEFINE INT_THREAD_PRIORITY}
{$DEFINE CPUI386}
{$UNDEF USE_BASEUNIX}
{$IFDEF KYLIX_3}
{$DEFINE KYLIX_3_OR_ABOVE}
{$ENDIF}
{$IFDEF KYLIX_3_OR_ABOVE}
{$DEFINE KYLIX_2_OR_ABOVE}
{$ELSE}
{$IFDEF KYLIX_2}
{$DEFINE KYLIX_2_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF KYLIX_2_OR_ABOVE}
{$DEFINE KYLIX_1_OR_ABOVE}
{$ELSE}
{$IFDEF KYLIX_1}
{$DEFINE KYLIX_1_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFNDEF KYLIX_3_OR_ABOVE}
{$DEFINE KYLIXCOMPAT}
{$ENDIF}
{$IFDEF KYLIX_2_OR_ABOVE}
{$DEFINE USE_ZLIB_UNIT}
{$ENDIF}
{$ENDIF}
// FPC (2+)
{$IFDEF FPC}
// TODO: In FreePascal 4.2.0+, a Delphi-like UnicodeString type is supported.
// However, String/(P)Char do not map to UnicodeString/(P)WideChar unless
// either {$MODE DelphiUnicode} or {$MODESWITCH UnicodeStrings} is used.
// We should consider enabling one of them so Indy uses the same Unicode logic
// in Delphi 2009+ and FreePascal 4.2.0+ and reduces IFDEFs (in particular,
// STRING_UNICODE_MISMATCH, see further below). However, FreePascal's RTL
// is largely not UnicodeString-enabled yet...
{$MODE Delphi}
//note that we may need further defines for widget types depending on
//what we do and what platforms we support in FPC.
//I'll let Marco think about that one.
{$IFDEF UNIX}
{$DEFINE USE_BASEUNIX}
{$IFDEF LINUX}
//In Linux for I386, you can choose between a Kylix-libc API or
//the standard RTL Unix API. Just pass -dKYLIXCOMPAT to the FPC compiler.
//I will see what I can do about the Makefile.
{$IFDEF KYLIXCOMPAT}
{$IFDEF CPUI386}
{$UNDEF USE_BASEUNIX}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$IFDEF USE_BASEUNIX}
{$UNDEF KYLIXCOMPAT}
{$ENDIF}
{$ENDIF}
// FPC_FULLVERSION was added in FPC 2.2.4
// Have to use Defined() or else Delphi compiler chokes, since it
// evaluates $IF statements before $IFDEF statements...
{$MACRO ON} // must be on in order to use versioning macros
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20701)}
{$DEFINE FPC_2_7_1_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20604)}
{$DEFINE FPC_2_6_4_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20602)}
{$DEFINE FPC_2_6_2_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20600)}
{$DEFINE FPC_2_6_0_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20404)}
{$DEFINE FPC_2_4_4_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20402)}
{$DEFINE FPC_2_4_2_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20400)}
{$DEFINE FPC_2_4_0_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20204)}
{$DEFINE FPC_2_2_4_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20202)}
{$DEFINE FPC_2_2_2_OR_ABOVE}
{$IFEND}
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20105)}
{$DEFINE FPC_2_1_5_OR_ABOVE}
{$IFEND}
// just in case
{$IFDEF FPC_2_7_1}
{$DEFINE FPC_2_7_1_OR_ABOVE}
{$ENDIF}
{$IFDEF FPC_2_6_4}
{$DEFINE FPC_2_6_4_OR_ABOVE}
{$ENDIF}
{$IFDEF FPC_2_6_2}
{$DEFINE FPC_2_6_2_OR_ABOVE}
{$ENDIF}
{$IFDEF FPC_2_6_0}
{$DEFINE FPC_2_6_0_OR_ABOVE}
{$ENDIF}
{$IFDEF FPC_2_4_4}
{$DEFINE FP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OVE}
{$ENDIF}
{$ENDIF}
{$IFDEF FPC_2_4_0_OR_ABOVE}
{$DEFINE FPC_2_2_4_OR_ABOVE}
{$ELSE}
{$IFDEF FPC_2_2_4}
{$DEFINE FPC_2_2_4_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF FPC_2_2_4_OR_ABOVE}
{$DEFINE FPC_2_2_2_OR_ABOVE}
{$ELSE}
{$IFDEF FPC_2_2_2}
{$DEFINE FPC_2_2_2_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF FPC_2_2_2_OR_ABOVE}
{$DEFINE FPC_2_2_0_OR_ABOVE}
{$ELSE}
{$IFDEF VER2_2}
{$DEFINE FPC_2_2_0_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF FPC_2_2_0_OR_ABOVE}
{$DEFINE FPC_2_1_5_OR_ABOVE}
{$ELSE}
{$IFDEF FPC_2_1_5}
{$DEFINE FPC_2_1_5_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{.$IFDEF FPC_2_7_1_OR_ABOVE}
// support for RawByteString and UnicodeString
{.$DEFINE VCL_2009}
{.$DEFINE DELPHI_2009}
{.$ELSE}
{$DEFINE VCL_70}
{$DEFINE DELPHI_7}
{.$ENDIF}
{$ENDIF}
// end FPC
{$IFDEF VCL_10_1_BERLIN}
{$DEFINE VCL_10_1_BERLIN_OR_ABOVE}
{$ENDIF}
{$IFDEF VCL_10_1_BERLIN_OR_ABOVE}
{$DEFINE VCL_10_0_SEATTLE_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_10_0_SEATTLE}
{$DEFINE VCL_10_0_SEATTLE_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_10_0_SEATTLE_OR_ABOVE}
{$DEFINE VCL_XE8_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_XE8}
{$DEFINE VCL_XE8_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_XE8_OR_ABOVE}
{$DEFINE V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{$ELSE}
{$IFDEF VCL_2009}
{$DEFINE VCL_2009_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_2009_OR_ABOVE}
{$DEFINE VCL_2007_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_2007}
{$DEFINE VCL_2007_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_2007_OR_ABOVE}
{$DEFINE VCL_2006_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_2006}
{$DEFINE VCL_2006_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_2006_OR_ABOVE}
{$DEFINE VCL_2005_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_2005}
{$DEFINE VCL_2005_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_2005_OR_ABOVE}
{$DEFINE VCL_8_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_80}
{$DEFINE VCL_8_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_8_OR_ABOVE}
{$DEFINE VCL_7_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_70}
{$DEFINE VCL_7_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_7_OR_ABOVE}
{$DEFINE VCL_6_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_60}
{$DEFINE VCL_6_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_6_OR_ABOVE}
{$DEFINE VCL_5_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_50}
{$DEFINE VCL_5_OR_ABOVE}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_5_OR_ABOVE}
{$DEFINE VCL_4_OR_ABOVE}
{$ELSE}
{$IFDEF VCL_40}
{$DEFINE VCL_4_OR_ABOVE}
{$ENDIF}
{$ENDIF}
// Normalize Delphi compiler defines to match FPC for consistency:
//
// CPU32 - any 32-bit CPU
// CPU64 - any 64-bit CPU
// WINDOWS - any Windows platform (32-bit, 64-bit, CE)
// WIN32 - Windows 32-bit
// WIN64 - Windows 64-bit
// WINCE - Windows CE
//
// Consult the "Free Pascal Programmer's Guide", Appendix G for the complete
// list of defines that are used. Do not work on this unless you understand
// what the FreePascal developers are doing. Not only do you have to
// descriminate with operating systems, but also with chip architectures
// are well.
//
// DCC Pulsar+ define the following values:
// ASSEMBLER
// DCC
// CONDITIONALEXPRESSIONS
// NATIVECODE
// UNICODE
// MACOS
// MACOS32
// MACOS64
// MSWINDOWS
// WIN32
// WIN64
// LINUX
// POSIX
// POSIX32
// CPU386
// CPUX86
// CPUX64
//
// Kylix defines the following values:
// LINUX
// (others??)
//
{$IFNDEF FPC}
// TODO: We need to use ENDIAN_BIG for big endian chip architectures,
// such as 680x0, PowerPC, Sparc, and MIPS, once DCC supports them,
// provided it does not already define its own ENDIAN values by then...
{$DEFINE ENDIAN_LITTLE}
{$IFNDEF VCL_6_OR_ABOVE}
{$DEFINE MSWINDOWS}
{$ENDIF}
{$IFDEF MSWINDOWS}
{$DEFINE WINDOWS}
{$ENDIF}
// TODO: map Pulsar's non-Windows platform defines...
{$IFDEF VCL_XE2_OR_ABOVE}
{$IFDEF CPU386}
//any 32-bit CPU
{$DEFINE CPU32}
//Intel 386 compatible chip architecture
{$DEFINE CPUI386}
{$ENDIF}
{$IFDEF CPUX86}
{$DEFINE CPU32}
{$ENDIF}
{$IFDEF CPUX64}
//any 64-bit CPU
{$DEFINE CPU64}
//AMD64 compatible chip architecture
{$DEFINE CPUX86_64} //historical name for AMD64
{$DEFINE CPUAMD64}
{$ENDIF}
{$ELSE}
{$IFNDEF DOTNET}
{$IFNDEF KYLIX}
{$DEFINE I386}
{$ENDIF}
{$ENDIF}
{$DEFINE CPU32}
{$ENDIF}
{$ENDIF}
{$IFDEF DOTNET}
//differences in DotNET Framework versions.
{$IFDEF VCL_2007_OR_ABOVE}
{$DEFINE DOTNET_2}
{$DEFINE DOTNET_2_OR_ABOVE}
{$ELSE}
{$DEFINE DOTNET_1_1}
{$ENDIF}
{$DEFINE DOTNET_1_1_OR_ABOVE}
// Extra include used in D7 for testing. Remove later when all comps are
// ported. Used to selectively exclude non ported parts. Allowed in places
// IFDEFs are otherwise not permitted.
{$DEFINE DOTNET_EXCLUDE}
{$ENDIF}
// Check for available features
{$IFDEF CBUILDER}
// When generating a C++ HPP file, if a class has no explicit constructor
// defined and contains compiler-managed members (xxxString, TDateTime,
// Variant, DelphiInterface, etc), the HPP will contain a forwarding
// inline constructor that implicitally initializes those managed members,
// which will overwrite any non-default initializations performed inside
// of InitComponent() overrides! In this situation, the workaround is to
// define an explicit constructor that forwards to the base class constructor
// manually.
{$DEFINE WORKAROUND_INLINE_CONSTRUCTORS}
{$ENDIF}
{$IFDEF VCL_5_OR_ABOVE}
{$IFNDEF FPC}
{$IFNDEF KYLIX}
{$DEFINE HAS_RemoveFreeNotification}
{$ENDIF}
{$ENDIF}
{$DEFINE HAS_GetObjectProp}
{$DEFINE HAS_TObjectList}
{$ENDIF}
{$IFDEF VCL_6_OR_ABOVE}
{$DEFINE HAS_PCardinal}
{$DEFINE HAS_PByte}
{$DEFINE HAS_PWord}
{$DEFINE HAS_PPointer}
{$DEFINE HAS_TList_Assign}
{$DEFINE HAS_sLineBreak}
{$DEFINE HAS_RaiseLastOSError}
{$DEFINE HAS_SysUtils_IncludeExcludeTrailingPathDelimiter}
{$DEFINE HAS_SysUtils_DirectoryExists}
{$DEFINE HAS_UNIT_DateUtils}
{$DEFINE HAS_UNIT_StrUtils}
{$DEFINE HAS_UNIT_Types}
{$DEFINE HAS_TryStrToInt}
{$DEFINE HAS_TryStrToInt64}
{$DEFINE HAS_TryEncodeDate}
{$DEFINE HAS_TryEncodeTime}
{$DEFINE HAS_ENUM_ELEMENT_VALUES}
{$IFNDEF FPC}
{$DEFINE HAS_IInterface}
{$DEFINE HAS_TSelectionEditor}
{$DEFINE HAS_TStringList_CaseSensitive}
{$IFNDEF KYLIX}
{$DEFINE HAS_DEPRECATED}
{$DEFINE HAS_SYMBOL_PLATFORM}
{$DEFINE HAS_UNIT_PLATFORM}
{$IFNDEF VCL_8_OR_ABOVE}
// Delphi 6 and 7 have an annoying bug that if a class method is declared as
// deprecated, the compiler will emit a "symbol is deprecated" warning
// on the method's implementation! So we will have to wrap implementations
// of deprecated methods with {$WARN SYMBOL_DEPRECATED OFF} directives
// to disable that warning.
{$DEFINE DEPRECATED_IMPL_BUG}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$IFNDEF DOTNET}
//Widget defines are omitted in .NET
{$DEFINE VCL_60_PLUS}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_7_OR_ABOVE}
{$IFNDEF FPC}
{$DEFINE HAS_UInt64}
{$DEFINE HAS_NAMED_THREADS}
{$DEFINE HAS_TStrings_ValueFromIndex}
{$ENDIF}
{$DEFINE HAS_TFormatSettings}
{$DEFINE HAS_PosEx}
{$IFNDEF VCL_70}
// not implemented in D7
{$DEFINE HAS_STATIC_TThread_Queue}
{$ENDIF}
{$IFNDEF CIL}
{$IFNDEF VCL_80}
// not implemented in D8 or .NET
{$DEFINE HAS_STATIC_TThread_Synchronize}
{$ENDIF}
{$ENDIF}
{$ELSE}
{$IFDEF CBUILDER_6}
{$DEFINE HAS_NAMED_THREADS}
{$ENDIF}
{$ENDIF}
{$IFNDEF VCL_2005_OR_ABOVE}
{$IFDEF DCC}
{$DEFINE HAS_InterlockedCompareExchange_Pointers}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_2006_OR_ABOVE}
{$DEFINE USE_INLINE}
{$DEFINE HAS_2PARAM_FileAge}
{$DEFINE HAS_System_RegisterExpectedMemoryLeak}
{$IFNDEF FREE_ON_FINAL}
{$IFNDEF DOTNET}
{$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
{$ENDIF}
{$ENDIF}
// UInt64 is emitted as signed __int64 instead of unsigned __int64 in HPP files
{$IFDEF CBUILDER}
{$DEFINE BROKEN_UINT64_HPPEMIT}
{$ENDIF}
{$ENDIF}
{$IFDEF VCL_2007_OR_ABOVE}
{$IFNDEF CBUILDER_2007}
// class properties are broken in C++Builder 2007, causing AVs at compile-time
{$DEFINE HAS_CLASSPROPERTIES}
{$ENDIF}
// Native(U)Int exist but are buggy, so do not use them yet
{.$DEFINE HAS_NativeInt}