A lightweight, zero-dependency compiler version detection include file (sgmVersions.inc) for Delphi, covering every release from Delphi 2 up to Delphi 13.
- Exact Version Defines: Defines
DELPHI_2throughDELPHI_13(DELPHI_10_1,DELPHI_XE2, etc.) for targeting a specific IDE release. - Cumulative ("And Up") Defines: Defines
DELPHI_2_UPthroughDELPHI_13_UPfor clean conditional compilation across multiple versions. - Legacy & Modern Ready: Works identically in classic 32-bit Delphi versions (without
CompilerVersionsupport) and modern Unicode / 64-bit compilers. - Single-File Drop-In: Just one
.incfile — easy to include directly or attach as a Git submodule.
- Copy
sgmVersions.incinto your project folder (or add it to your Delphi Search Path). - Include it at the top of your Pascal unit right after the
unitdeclaration:
unit SomeUnit;
{$I sgmVersions.inc}
interface
uses
SysUtils, Classes
{$IFDEF DELPHI_XE2_UP}
, System.UITypes
{$ENDIF}
;
implementation
function GetDefaultFontName: string;
begin
{$IFDEF DELPHI_2007_UP}
Result := 'Segoe UI';
{$ELSE}
Result := 'Tahoma';
{$ENDIF}
end;
end.| Delphi Version | Compiler (VERxxx) |
Exact Define | Cumulative Define |
|---|---|---|---|
| Delphi 2 | VER90 |
DELPHI_2 |
DELPHI_2_UP |
| Delphi 3 | VER100 |
DELPHI_3 |
DELPHI_3_UP |
| Delphi 4 | VER120 |
DELPHI_4 |
DELPHI_4_UP |
| Delphi 5 | VER130 |
DELPHI_5 |
DELPHI_5_UP |
| Delphi 6 | VER140 |
DELPHI_6 |
DELPHI_6_UP |
| Delphi 7 | VER150 |
DELPHI_7 |
DELPHI_7_UP |
| Delphi 2005 | VER170 |
DELPHI_2005 |
DELPHI_2005_UP |
| Delphi 2006 | VER180 |
DELPHI_2006 |
DELPHI_2006_UP |
| Delphi 2007 | VER190 |
DELPHI_2007 |
DELPHI_2007_UP |
| Delphi 2009 | VER200 |
DELPHI_2009 |
DELPHI_2009_UP |
| Delphi 2010 | VER210 |
DELPHI_2010 |
DELPHI_2010_UP |
| Delphi XE | VER220 |
DELPHI_XE |
DELPHI_XE_UP |
| Delphi XE2 | VER230 |
DELPHI_XE2 |
DELPHI_XE2_UP |
| Delphi XE3 | VER240 |
DELPHI_XE3 |
DELPHI_XE3_UP |
| Delphi XE4 | VER250 |
DELPHI_XE4 |
DELPHI_XE4_UP |
| Delphi XE5 | VER260 |
DELPHI_XE5 |
DELPHI_XE5_UP |
| Delphi XE6 | VER270 |
DELPHI_XE6 |
DELPHI_XE6_UP |
| Delphi XE7 | VER280 |
DELPHI_XE7 |
DELPHI_XE7_UP |
| Delphi XE8 | VER290 |
DELPHI_XE8 |
DELPHI_XE8_UP |
| Delphi 10 Seattle | VER300 |
DELPHI_10 |
DELPHI_10_UP |
| Delphi 10.1 Berlin | VER310 |
DELPHI_10_1 |
DELPHI_10_1_UP |
| Delphi 10.2 Tokyo | VER320 |
DELPHI_10_2 |
DELPHI_10_2_UP |
| Delphi 10.3 Rio | VER330 |
DELPHI_10_3 |
DELPHI_10_3_UP |
| Delphi 10.4 Sydney | VER340 |
DELPHI_10_4 |
DELPHI_10_4_UP |
| Delphi 11 Alexandria | VER350 |
DELPHI_11 |
DELPHI_11_UP |
| Delphi 12 Athens | VER360 |
DELPHI_12 |
DELPHI_12_UP |
| Delphi 13 | VER370 |
DELPHI_13 |
DELPHI_13_UP |
Distributed under the MIT License. See LICENSE for more information.