Over the years there have been multiple projects to provide a single, standard include file for identifying all Delphi versions with a more user friendly name than VERxxx. They usually looked like this:

Over the years there have been multiple projects to provide a single, standard include file for identifying all Delphi versions with a more user friendly name than VERxxx. They usually looked like this:

{$IFDEF VER130}
{$DEFINE Delphi5up}
{$ENDIF}

{$IFDEF VER140}
{$DEFINE Delphi5up}
{$DEFINE Delphi6up}
{$ENDIF}

{$IFDEF VER150}
{$DEFINE Delphi5up}
{$DEFINE Delphi6up}
{$DEFINE Delphi7up}
{$ENDIF}

// and so on

I remember/know of:

 - delphiversions.inc which seems to have vanished from the face of the earth. All I could find on Google were some references to it from Delphi projects which have it in their repository.

- jedi.inc which seems to be the most comprehensive one and is also actively maintained. It not only provides defines for compiler / RTL and other versions but also, most useful in my opinion, defines for language and RTL features like SUPPORTS_INT64 or HAS_UNIT_ANSISTRINGS, which I prefer greatly over using the VERxxx or DelphiXx_UP defines.

Probably every component vendor also has his own version of such a file. (And so does GExperts.) Others use jedi.inc (dxgettext and my own dzlib use it).

Are there any others? What do you use to determine the Delphi version and other important characteristic properties of your building environment? Or do you rely on the builtin VERxxx defines?

Comments