Skip to content

Commit 3d90e91

Browse files
committed
Updated CompilerDefines to recognise VER350 (Delphi Alexandria)
1 parent d57348c commit 3d90e91

File tree

2 files changed

+82
-19
lines changed

2 files changed

+82
-19
lines changed

src/IdCompilerDefines.inc

Lines changed: 76 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
{.$IFDEF IdIPv6} // use IPv6 by default
1717

1818
{$DEFINE INDY100}
19-
{$DEFINE 10_6_2} //so developers can IFDEF for this specific version
19+
{$DEFINE 10_7_0} //so developers can IFDEF for this product version
20+
{$DEFINE 10_7_0_0} //so developers can IFDEF for this specific version
2021

2122
// When generating C++Builder output files, certain workarounds to compiler
2223
// problems need to be enabled! When invoking DCC on the command-line, use
@@ -36,8 +37,11 @@
3637

3738
// $DEFINE the following if the global objects in the IdStack and IdThread
3839
// units should be freed on finalization
39-
{.$DEFINE FREE_ON_FINAL}
40+
{$IFDEF FPC}
41+
{$DEFINE FREE_ON_FINAL}
42+
{$ELSE}
4043
{$UNDEF FREE_ON_FINAL}
44+
{$ENDIF}
4145

4246
// Make sure the following is $DEFINE'd only for suitable environments
4347
// as specified further below. This works in conjunction with the
@@ -440,6 +444,30 @@
440444
{$ENDIF}
441445
{$ENDIF}
442446

447+
//Delphi & CBuilder 12.0 Athens (Yukon)
448+
{$IFDEF VER360}
449+
{$DEFINE VCL_12}
450+
{$IFDEF CBUILDER}
451+
{$DEFINE CBUILDER_12}
452+
{$ELSE}
453+
{$DEFINE DELPHI_12}
454+
{$ENDIF}
455+
{$ENDIF}
456+
457+
//Delphi & CBuilder 13.0+ (?)
458+
{$IFDEF CONDITIONALEXPRESSIONS}
459+
{$IF CompilerVersion >= 37}
460+
{$MESSAGE WARN 'Unknown compiler version detected! Assuming >= 13.x '}
461+
{$DEFINE VCL_UNKNOWN_VERSION}
462+
{$DEFINE VCL_13}
463+
{$IFDEF CBUILDER}
464+
{$DEFINE CBUILDER_13}
465+
{$ELSE}
466+
{$DEFINE DELPHI_13}
467+
{$ENDIF}
468+
{$IFEND}
469+
{$ENDIF}
470+
443471
// Kylix
444472
//
445473
//Important: Don't use CompilerVersion here as IF's are evaluated before
@@ -526,11 +554,6 @@
526554
// {$MODE DelphiUnicode} anyway, and then deal with any RTL function issues
527555
// on an as-needed basis...
528556
{$MODE Delphi}
529-
{$IFDEF FPC_2_7_1_OR_ABOVE}
530-
{.$MODE DelphiUnicode}
531-
{.$MODESWITCH UnicodeStrings}
532-
{.$CODEPAGE UTF8} // needed for Unicode string literals to work properly
533-
{$ENDIF}
534557
//note that we may need further defines for widget types depending on
535558
//what we do and what platforms we support in FPC.
536559
//I'll let Marco think about that one.
@@ -729,6 +752,9 @@
729752

730753
{.$IFDEF FPC_2_7_1_OR_ABOVE}
731754
// support for RawByteString and UnicodeString
755+
{.$MODE DelphiUnicode}
756+
{.$MODESWITCH UnicodeStrings}
757+
{.$CODEPAGE UTF8} // needed for Unicode string literals to work properly
732758
{.$DEFINE VCL_2009}
733759
{.$DEFINE DELPHI_2009}
734760
{.$ELSE}
@@ -739,8 +765,24 @@
739765

740766
// end FPC
741767

742-
{$IFDEF VCL_11}
768+
{$IFDEF VCL_13}
769+
{$DEFINE VCL_13_OR_ABOVE}
770+
{$ENDIF}
771+
772+
{$IFDEF VCL_13_OR_ABOVE}
773+
{$DEFINE VCL_12_OR_ABOVE}
774+
{$ELSE}
775+
{$IFDEF VCL_12}
776+
{$DEFINE VCL_12_OR_ABOVE}
777+
{$ENDIF}
778+
{$ENDIF}
779+
780+
{$IFDEF VCL_12_OR_ABOVE}
743781
{$DEFINE VCL_11_OR_ABOVE}
782+
{$ELSE}
783+
{$IFDEF VCL_11}
784+
{$DEFINE VCL_11_OR_ABOVE}
785+
{$ENDIF}
744786
{$ENDIF}
745787

746788
{$IFDEF VCL_11_OR_ABOVE}
@@ -982,7 +1024,7 @@
9821024
{$DEFINE ENDIAN_LITTLE}
9831025
{$IFNDEF VCL_6_OR_ABOVE}
9841026
{$IFNDEF POSIX}
985-
{$DEFINE MSWINDOWS}
1027+
{$DEFINE MSWINDOWS}
9861028
{$ENDIF}
9871029
{$ENDIF}
9881030
{$IFDEF MSWINDOWS}
@@ -1064,6 +1106,7 @@
10641106
{$ENDIF}
10651107
{$DEFINE HAS_GetObjectProp}
10661108
{$DEFINE HAS_TObjectList}
1109+
{$DEFINE HAS_StrToInt64Def}
10671110
{$ENDIF}
10681111

10691112
{$IFDEF VCL_6_OR_ABOVE}
@@ -1115,6 +1158,10 @@
11151158
{$DEFINE HAS_NAMED_THREADS}
11161159
{$DEFINE HAS_TStrings_NameValueSeparator}
11171160
{$DEFINE HAS_TStrings_ValueFromIndex}
1161+
// Note: there is a ZLib unit available, but it doesn't have everything
1162+
// that is available in the System.ZLib unit in Delphi XE2+, so we are
1163+
// not going to use this ZLib unit yet...
1164+
{.$DEFINE HAS_UNIT_ZLib}
11181165
{$ENDIF}
11191166
{$DEFINE HAS_TFormatSettings}
11201167
{$DEFINE HAS_PosEx}
@@ -1134,7 +1181,13 @@
11341181
{$ENDIF}
11351182
{$ENDIF}
11361183

1137-
{$IFNDEF VCL_2005_OR_ABOVE}
1184+
{$IFDEF VCL_2005_OR_ABOVE}
1185+
{$IFDEF DCC}
1186+
// class helpers were first introduced in D2005, but were buggy and not
1187+
// officially supported until D2006...
1188+
{.$DEFINE HAS_CLASS_HELPER}
1189+
{$ENDIF}
1190+
{$ELSE}
11381191
{$IFDEF DCC}
11391192
// InterlockedCompareExchange() was declared in the Windows unit using Pointer
11401193
// parameters until Delphi 2005, when it was switched to Longint parameters
@@ -1146,6 +1199,8 @@
11461199
{$IFDEF VCL_2006_OR_ABOVE}
11471200
{$DEFINE USE_INLINE}
11481201
{$DEFINE HAS_2PARAM_FileAge}
1202+
{$DEFINE HAS_TStrings_LineBreak} // TODO: when was LineBreak introduced?
1203+
{$DEFINE HAS_CLASS_HELPER}
11491204
{$IFDEF WINDOWS}
11501205
// System.RegisterExpectedMemoryLeak() is only available on Windows at this time
11511206
{$DEFINE HAS_System_RegisterExpectedMemoryLeak}
@@ -1166,7 +1221,6 @@
11661221
// Native(U)Int exist but are buggy, so do not use them yet
11671222
{.$DEFINE HAS_NativeInt}
11681223
{.$DEFINE HAS_NativeUInt}
1169-
{$DEFINE HAS_StrToInt64Def}
11701224
{$DEFINE HAS_DWORD_PTR}
11711225
{$DEFINE HAS_ULONG_PTR}
11721226
{$DEFINE HAS_ULONGLONG}
@@ -1205,6 +1259,7 @@
12051259
{$DEFINE HAS_UInt16}
12061260
{$DEFINE HAS_Int32}
12071261
{$DEFINE HAS_UInt32}
1262+
{$DEFINE HAS_UIntToStr}
12081263
// UInt64 is now emitted as unsigned __int64 in HPP files
12091264
{$IFDEF CBUILDER}
12101265
{$UNDEF BROKEN_UINT64_HPPEMIT}
@@ -1263,6 +1318,7 @@
12631318
{$DEFINE HAS_ComponentPlatformsAttribute_OSX32}
12641319
{$DEFINE HAS_System_ReturnAddress}
12651320
{$DEFINE HAS_DIRECTIVE_WARN_DEFAULT}
1321+
{$DEFINE HAS_UNIT_System_ZLib}
12661322
{$ENDIF}
12671323

12681324
{$IFDEF VCL_XE3_OR_ABOVE}
@@ -1456,6 +1512,7 @@
14561512
{$ENDIF}
14571513
{$DEFINE HAS_UNIT_ctypes}
14581514
{$DEFINE HAS_sLineBreak}
1515+
{$DEFINE HAS_TStrings_LineBreak} // TODO: when was LineBreak introduced?
14591516
{$IFDEF FPC_HAS_UNICODESTRING}
14601517
{$DEFINE HAS_UnicodeString}
14611518
{$ELSE}
@@ -1475,6 +1532,7 @@
14751532
{$IFDEF FPC_2_6_0_OR_ABOVE}
14761533
{$DEFINE HAS_NativeInt}
14771534
{$DEFINE HAS_NativeUInt}
1535+
{$DEFINE HAS_CLASS_HELPER}
14781536
{$ENDIF}
14791537
{$IFDEF FPC_2_6_2_OR_ABOVE}
14801538
{$DEFINE HAS_Int8}
@@ -1505,6 +1563,7 @@
15051563
{$IFDEF FPC_3_1_1_OR_ABOVE}
15061564
{$DEFINE HAS_STATIC_TThread_ForceQueue} // requires rev 37359+
15071565
{$DEFINE HAS_PRawByteString}
1566+
{$DEFINE HAS_UIntToStr} // requires rev 40529+
15081567
{$ENDIF}
15091568
{$ENDIF}
15101569

@@ -1599,7 +1658,7 @@
15991658
{$IFDEF WIN32_OR_WIN64}
16001659
{$DEFINE USE_ZLIB_UNIT}
16011660
{$IFNDEF DCC_NEXTGEN}
1602-
{$DEFINE USE_OPENSSL} // !!!·MOVED·HERE·BY·EMBT
1661+
{$DEFINE USE_OPENSSL} // !!! MOVED HERE BY EMBT
16031662
{$DEFINE USE_SSPI}
16041663
{$IFDEF STRING_IS_UNICODE}
16051664
{$DEFINE SSPI_UNICODE}
@@ -1627,7 +1686,7 @@
16271686
{$IFDEF UNIX}
16281687
{$DEFINE USE_OPENSSL}
16291688
{$DEFINE USE_ZLIB_UNIT}
1630-
{$DEFINE HAS_getifaddrs}
1689+
{$DEFINE HAS_getifaddrs}
16311690
{$ENDIF}
16321691

16331692
{$IFDEF MACOS}
@@ -1665,6 +1724,10 @@
16651724
{$DEFINE HAS_getifaddrs}
16661725
{$ENDIF}
16671726

1727+
{$IFDEF ANDROID}
1728+
{$UNDEF HAS_getifaddrs}
1729+
{$ENDIF}
1730+
16681731
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
16691732
{$DEFINE REQUIRES_PROPER_ALIGNMENT}
16701733
{$ENDIF}

src/opensslHdrs/IdSSLOpenSSLAPI.pas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ TOpenSSL_C_TM = record
293293

294294
function GetIOpenSSLDDL: IOpenSSLDLL;
295295
{$IFNDEF OPENSSL_STATIC_LINK_MODEL}
296-
function LoadLibCryptoFunction(const AProcName: PChar): Pointer;
297-
function LoadLibSSLFunction(const AProcName: PChar): Pointer;
296+
function LoadLibCryptoFunction(const AProcName: string): Pointer;
297+
function LoadLibSSLFunction(const AProcName: string): Pointer;
298298

299299
type
300300
TOpenSSLLoadProc = procedure(LibVersion: TOpenSSL_C_UINT; const AFailed: TStringList);
@@ -536,14 +536,14 @@ function TOpenSSLDynamicLibProvider.Init : boolean;
536536
Result := Load;
537537
end;
538538

539-
function LoadLibCryptoFunction(const AProcName: PChar): Pointer;
539+
function LoadLibCryptoFunction(const AProcName: string): Pointer;
540540
begin
541-
Result := GetProcAddress(TOpenSSLDynamicLibProvider.FOpenSSLDDL.GetLibCryptoHandle,AProcName);
541+
Result := GetProcAddress(TOpenSSLDynamicLibProvider.FOpenSSLDDL.GetLibCryptoHandle,PChar(AProcName));
542542
end;
543543

544-
function LoadLibSSLFunction(const AProcName: PChar): Pointer;
544+
function LoadLibSSLFunction(const AProcName: string): Pointer;
545545
begin
546-
Result := GetProcAddress(TOpenSSLDynamicLibProvider.FOpenSSLDDL.GetLibSSLHandle,AProcName);
546+
Result := GetProcAddress(TOpenSSLDynamicLibProvider.FOpenSSLDDL.GetLibSSLHandle,PChar(AProcName));
547547
end;
548548

549549
procedure TOpenSSLDynamicLibProvider.SetOpenSSLPath(const Value : string);

0 commit comments

Comments
 (0)