Skip to content

Commit

Permalink
Future proofing inc file
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentparrett committed Sep 5, 2023
1 parent 02bedad commit 30f78e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 328 deletions.
4 changes: 0 additions & 4 deletions Source/Delphi.Mocks.MethodData.pas
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ TMethodData = class(TInterfacedObject,IMethodData)
destructor Destroy;override;
end;

{$IFNDEF DELPHI_XE_UP}
ENotImplemented = class(Exception);
{$ENDIF}

implementation

uses
Expand Down
326 changes: 4 additions & 322 deletions Source/Delphi.Mocks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@
{ }
{***************************************************************************}

//Basic Version of Compiler Supported
//Basic Version of Compiler Supported - XE2 Minimum
{$IFDEF CONDITIONALEXPRESSIONS} //Started being defined with D2009
{$IF CompilerVersion < 23.0} // Before RAD Studio XE2
{$DEFINE UNSUPPORTED_COMPILER_VERSION}
{$IFEND}
{$IF CompilerVersion > 22.0} // XE2 or later
{$DEFINE SUPPORTS_REGEX}
{$IFEND}
{$ELSE}
{$DEFINE UNSUPPORTED_COMPILER_VERSION}
{$ENDIF}
Expand All @@ -39,323 +36,8 @@
Unsupported Compiler Version (Delphi XE2 or later required!)
{$ENDIF}

{$IF CompilerVersion > 28.0} // XE8 up
{$DEFINE HAS_SYSTEM_HASH}
{$IFEND}

//Use namespaces
{$DEFINE USE_NS}

{$DEFINE DELPHI_XE104_DOWN}
{$DEFINE DELPHI_XE103_DOWN}
{$DEFINE DELPHI_XE102_DOWN}
{$DEFINE DELPHI_XE101_DOWN}
{$DEFINE DELPHI_XE10_DOWN}
{$DEFINE DELPHI_XE8_DOWN}
{$DEFINE DELPHI_XE7_DOWN}
{$DEFINE DELPHI_XE6_DOWN}
{$DEFINE DELPHI_XE5_DOWN}
{$DEFINE DELPHI_XE4_DOWN}
{$DEFINE DELPHI_XE3_DOWN}
{$DEFINE DELPHI_XE2_DOWN}


{$IFDEF VER230} // RAD Studio XE2
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$ENDIF VER230}

{$IFDEF VER240} // RAD Studio XE3
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$ENDIF VER240}

{$IFDEF VER250} // RAD Studio XE4
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$ENDIF VER250}

{$IFDEF VER260} // RAD Studio XE5
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$ENDIF VER260}

{$IFDEF VER270} // RAD Studio XE6
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$ENDIF VER270}

{$IFDEF VER280} // RAD Studio XE7
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$ENDIF VER280}

{$IFDEF VER290} // RAD Studio XE8
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}

{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$ENDIF VER290}

{$IFDEF VER300} // RAD Studio 10 Seattle
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}
{$DEFINE DELPHIX_XE10_UP}
{$DEFINE DELPHIX_XE10}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$UNDEF DELPHI_XE8_DOWN}
{$ENDIF VER300}

{$IFDEF VER310} // RAD Studio 10.1 Berlin
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}
{$DEFINE DELPHIX_SEATTLE_UP}
{$DEFINE DELPHIX_SEATTLE}
{$DEFINE DELPHI_XE10_UP}
{$DEFINE DELPHI_XE101_UP}
{$DEFINE DELPHI_XE101}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$UNDEF DELPHI_XE8_DOWN}
{$UNDEF DELPHI_XE10_DOWN}
{$ENDIF VER310}

{$IFDEF VER320} // RAD Studio 10.2 Tokyo
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}
{$DEFINE DELPHIX_SEATTLE_UP}
{$DEFINE DELPHIX_SEATTLE}
{$DEFINE DELPHI_XE10_UP}
{$DEFINE DELPHI_XE101_UP}
{$DEFINE DELPHI_XE102_UP}
{$DEFINE DELPHI_XE102}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$UNDEF DELPHI_XE8_DOWN}
{$UNDEF DELPHI_XE10_DOWN}
{$UNDEF DELPHI_XE101_DOWN}
{$ENDIF VER320}

{$IFDEF VER330} // RAD Studio 10.3
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}
{$DEFINE DELPHIX_SEATTLE_UP}
{$DEFINE DELPHIX_SEATTLE}
{$DEFINE DELPHI_XE10_UP}
{$DEFINE DELPHI_XE101_UP}
{$DEFINE DELPHI_XE102_UP}
{$DEFINE DELPHI_XE103_UP}
{$DEFINE DELPHI_XE103}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$UNDEF DELPHI_XE8_DOWN}
{$UNDEF DELPHI_XE10_DOWN}
{$UNDEF DELPHI_XE101_DOWN}
{$UNDEF DELPHI_XE102_DOWN}
{$ENDIF VER330}

{$IFDEF VER340} // RAD Studio 10.4
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}
{$DEFINE DELPHIX_SEATTLE_UP}
{$DEFINE DELPHIX_SEATTLE}
{$DEFINE DELPHI_XE10_UP}
{$DEFINE DELPHI_XE101_UP}
{$DEFINE DELPHI_XE102_UP}
{$DEFINE DELPHI_XE103_UP}
{$DEFINE DELPHI_XE104_UP}
{$DEFINE DELPHI_XE103}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$UNDEF DELPHI_XE8_DOWN}
{$UNDEF DELPHI_XE10_DOWN}
{$UNDEF DELPHI_XE101_DOWN}
{$UNDEF DELPHI_XE102_DOWN}
{$UNDEF DELPHI_XE103_DOWN}
{$ENDIF VER340}

{$IFDEF VER350} // RAD Studio 11.0
{$DEFINE DELPHI_2010_UP}
{$DEFINE DELPHI_XE_UP}
{$DEFINE DELPHI_XE2_UP}
{$DEFINE DELPHI_XE3_UP}
{$DEFINE DELPHI_XE4_UP}
{$DEFINE DELPHI_XE5_UP}
{$DEFINE DELPHI_XE6_UP}
{$DEFINE DELPHI_XE7}
{$DEFINE DELPHI_XE7_UP}
{$DEFINE DELPHI_XE8_UP}
{$DEFINE DELPHIX_SEATTLE_UP}
{$DEFINE DELPHIX_SEATTLE}
{$DEFINE DELPHI_XE10_UP}
{$DEFINE DELPHI_XE101_UP}
{$DEFINE DELPHI_XE102_UP}
{$DEFINE DELPHI_XE103_UP}
{$DEFINE DELPHI_XE104_UP}
{$DEFINE DELPHI_XE110_UP}
{$DEFINE DELPHI_XE103}
{$DEFINE SUPPORTS_REGEX}
{$UNDEF DELPHI_2010_DOWN}
{$UNDEF DELPHI_XE_DOWN}
{$UNDEF DELPHI_XE2_DOWN}
{$UNDEF DELPHI_XE3_DOWN}
{$UNDEF DELPHI_XE4_DOWN}
{$UNDEF DELPHI_XE5_DOWN}
{$UNDEF DELPHI_XE6_DOWN}
{$UNDEF DELPHI_XE7_DOWN}
{$UNDEF DELPHI_XE8_DOWN}
{$UNDEF DELPHI_XE10_DOWN}
{$UNDEF DELPHI_XE101_DOWN}
{$UNDEF DELPHI_XE102_DOWN}
{$UNDEF DELPHI_XE103_DOWN}
{$UNDEF DELPHI_XE104_DOWN}
{$ENDIF VER340}
4 changes: 2 additions & 2 deletions Source/Delphi.Mocks.pas
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ implementation
Delphi.Mocks.AutoMock,
Delphi.Mocks.Validation,
Delphi.Mocks.Helpers
{$IFDEF DELPHI_XE8_UP}
{$IFDEF HAS_SYSTEM_HASH}
,System.Hash
{$ENDIF};

Expand Down Expand Up @@ -741,7 +741,7 @@ function ItRec.DefaultComparer<T>: IEqualityComparer<T>;
end,
function(const Value: T): Integer
begin
{$IFDEF DELPHI_XE8_UP}
{$IFDEF HAS_SYSTEM_HASH}
Result := THashBobJenkins.GetHashValue(Value, SizeOf(Value));
{$ELSE}
Result := BobJenkinsHash(Value, SizeOf(Value), 0);
Expand Down

0 comments on commit 30f78e3

Please sign in to comment.