MahdiSafsafi/DDetours

Does not compile with Delphi 2009

dummzeuch opened this issue · 2 comments

Delphi 2009 still does not have a PNativeInt type, so the change I proposed to LegacyTypes for Delphi 7 must also include Delphi 2009 which leads to:

{$IF (CompilerVersion >= 15) and (CompilerVersion <= 20)}
// Delphi 7 to 2009: PNativeInt doesn't exist
type
PNativeInt=^NativeInt;
{$IFEND}

Also, there is an error in Defs.inc: The CompilerVersion for Delphi 2009 is 20, but that is also used to define DELPHI_2010_UP. The correct definition should be:

{$IF CompilerVersion >= 21}
{$DEFINE DELPHI_2010_UP}
{$IFEND}

Delphi 2009 has got a TypInfo unit but it does not declare tkProcedure, so even adding Typinfo to the uses clause does not make DDetours compile:
[DCC Error] DDetours.pas(2679): E2003 Undeclared identifier: 'tkProcedure'

The easiest fix would be to just not define {$DEFINE SUPPORTS_GENERICS} for Delphi 2009. It would reduce functionality for Delphi 2009 to the one in Delphi 2007. I'm not sure which consequences this has.