{******************************************************************************}
{                       CnPack For Delphi/C++Builder                           }
{                     中国人自己的开放源码第三方开发包                         }
{                   (C)Copyright 2001-2025 CnPack 开发组                       }
{                   ------------------------------------                       }
{                                                                              }
{            本开发包是开源的自由软件，您可以遵照 CnPack 的发布协议来修        }
{        改和重新发布这一程序。                                                }
{                                                                              }
{            发布这一开发包的目的是希望它有用，但没有任何担保。甚至没有        }
{        适合特定目的而隐含的担保。更详细的情况请参阅 CnPack 发布协议。        }
{                                                                              }
{            您应该已经和开发包一起收到一份 CnPack 发布协议的副本。如果        }
{        还没有，可访问我们的网站：                                            }
{                                                                              }
{            网站地址：https://www.cnpack.org                                  }
{            电子邮件：master@cnpack.org                                       }
{                                                                              }
{******************************************************************************}

{******************************************************************************}
{                                                                              }
{               备注：该单元为公共编译指令和编译器版本信息包含文件             }
{                   该单元的内容部分参考了 JCL 和 GExperts                     }
{                                                                              }
{******************************************************************************}

//==============================================================================
// 功能配置选项
//==============================================================================

{$IFDEF FPC}
  // Free Pascal Compiler 3.x Up Definitions
  {$DEFINE SUPPORT_PASCAL}    // Pascal
  {$DEFINE SUPPORT_UINT64}    // UInt64
  {$DEFINE SUPPORT_32_AND_64} // 支持 32 和 64 位，可用 NativeInt 等
  {$DEFINE SUPPORT_ENCODING}  // Unicode 字符串支持 Encoding 转换
  {$IFDEF SYSTEMINLINE}
    {$DEFINE SUPPORT_INLINE}  // inline
  {$ENDIF}

  {$DEFINE OBJECT_HAS_TOSTRING} // TObject.ToString
  {$DEFINE TBYTES_DEFINED}

  // 以下是 CPU 定义从 FPC 映射到 Delphi
  {$IFDEF CPU386}     // Intel 32 CPU
    {$DEFINE CPU32BITS}
    {$DEFINE CPUX86}
    {$asmMode intel}
  {$ENDIF}
  {$IFDEF CPUi386}
    {$DEFINE CPU32BITS}
    {$DEFINE CPUX86}
    {$asmMode intel}
  {$ENDIF}

  {$IFDEF CPUAMD64}   // Intel 64 CPU
    {$DEFINE CPU64BITS}
    {$DEFINE CPUX64}
    {$asmMode intel}
  {$ENDIF}
  {$IFDEF CPUX86_64}
    {$DEFINE CPU64BITS}
    {$DEFINE CPUX64}
    {$asmMode intel}
  {$ENDIF}
  {$IFDEF CPUIA64}
    {$DEFINE CPU64BITS}
    {$DEFINE CPUX64}
    {$asmMode intel}
  {$ENDIF}

  {$IFDEF CPUARM}      // ARM 32 bit processor
    {$DEFINE CPU32BITS}
    {$DEFINE CPUARM}
    {$DEFINE CPUARM32}
  {$ENDIF}

  {$IFDEF CPUAARCH64}  // ARM 64 bit processor
    {$DEFINE CPU64BITS}
    {$DEFINE CPUARM}
    {$DEFINE CPUARM64}
  {$ENDIF}

  {$mode Delphi}       // Delphi Compatibility, not DelphiUnicode。注意源码中勿重复声明
{$ELSE FPC} // Below is for Delphi Compiler

//{$DEFINE PERSONAL_EDITION}
{$DEFINE ENTERPRISE_EDITION}

{$IFNDEF PERSONAL_EDITION}
  {$DEFINE SUPPORT_DB}
  {$DEFINE SUPPORT_ADO}
{$ENDIF}

//==============================================================================
// 产生编译器版本信息
//==============================================================================

{$IFDEF VER360}
  {$DEFINE COMPILER29}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI29}
  {$DEFINE DELPHI120_ATHENS}
  {$DEFINE BCB28}
  {$DEFINE BCB120_ATHENS}
  {$DEFINE BDS23}
{$ENDIF}

{$IFDEF VER350}
  {$DEFINE COMPILER28}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI28}
  {$DEFINE DELPHI110_ALEXANDRIA}
  {$DEFINE BCB28}
  {$DEFINE BCB110_ALEXANDRIA}
  {$DEFINE BDS22}
{$ENDIF}

{$IFDEF VER340}
  {$DEFINE COMPILER27}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI27}
  {$DEFINE DELPHI104_SYDNEY}
  {$DEFINE BCB27}
  {$DEFINE BCB104_SYDNEY}
  {$DEFINE BDS21}
{$ENDIF}

{$IFDEF VER330}
  {$DEFINE COMPILER26}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI26}
  {$DEFINE DELPHI103_RIO}
  {$DEFINE BCB26}
  {$DEFINE BCB103_RIO}
  {$DEFINE BDS20}
{$ENDIF}

{$IFDEF VER320}
  {$DEFINE COMPILER25}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI25}
  {$DEFINE DELPHI102_TOKYO}
  {$DEFINE BCB25}
  {$DEFINE BCB102_TOKYO}
  {$DEFINE BDS19}
{$ENDIF}

{$IFDEF VER310}
  {$DEFINE COMPILER24}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI24}
  {$DEFINE DELPHI101_BERLIN}
  {$DEFINE BCB24}
  {$DEFINE BCB101_BERLIN}
  {$DEFINE BDS18}
{$ENDIF}

{$IFDEF VER300}
  {$DEFINE COMPILER23}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI23}
  {$DEFINE DELPHI10_SEATTLE}
  {$DEFINE BCB23}
  {$DEFINE BCB10_SEATTLE}
  {$DEFINE BDS17}
{$ENDIF}

{$IFDEF VER290}
  {$DEFINE COMPILER22}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI22}
  {$DEFINE DELPHIXE8}
  {$DEFINE BCB22}
  {$DEFINE BCBXE8}
  {$DEFINE BDS16}
{$ENDIF}

{$IFDEF VER280}
  {$DEFINE COMPILER21}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI21}
  {$DEFINE DELPHIXE7}
  {$DEFINE BCB21}
  {$DEFINE BCBXE7}
  {$DEFINE BDS15}
{$ENDIF}

{$IFDEF VER270}
  {$DEFINE COMPILER20}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI20}
  {$DEFINE DELPHIXE6}
  {$DEFINE BCB20}
  {$DEFINE BCBXE6}
  {$DEFINE BDS14}
{$ENDIF}

{$IFDEF VER260}
  {$DEFINE COMPILER19}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI19}
  {$DEFINE DELPHIXE5}
  {$DEFINE BCB19}
  {$DEFINE BCBXE5}
  {$DEFINE BDS12}
{$ENDIF}

{$IFDEF VER250}
  {$DEFINE COMPILER18}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI18}
  {$DEFINE DELPHIXE4}
  {$DEFINE BCB18}
  {$DEFINE BCBXE4}
  {$DEFINE BDS11}
{$ENDIF}

{$IFDEF VER240}
  {$DEFINE COMPILER17}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI17}
  {$DEFINE DELPHIXE3}
  {$DEFINE DELPHI2013}
  {$DEFINE BCB17}
  {$DEFINE BCBXE3}
  {$DEFINE BCB2013}
  {$DEFINE BDS10}
  {$DEFINE BDS2013}
{$ENDIF}

{$IFDEF VER230}
  {$DEFINE COMPILER16}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI16}
  {$DEFINE DELPHIXE2}
  {$DEFINE DELPHI2012}
  {$DEFINE BCB16}
  {$DEFINE BCBXE2}
  {$DEFINE BCB2012}
  {$DEFINE BDS9}
  {$DEFINE BDS2012}
{$ENDIF}

{$IFDEF VER220}
  {$DEFINE COMPILER15}
  {$IFDEF LINUX}
    {$DEFINE UCL10}
  {$ELSE}
    {$DEFINE VCL71}
  {$ENDIF}
  {$DEFINE DELPHI15}
  {$DEFINE DELPHIXE}
  {$DEFINE DELPHI2011}
  {$DEFINE BCB15}
  {$DEFINE BCBXE}
  {$DEFINE BCB2011}
  {$DEFINE BDS8}
  {$DEFINE BDS2011}
{$ENDIF}

{$IFDEF VER210}
  {$DEFINE COMPILER14}
  {$DEFINE VCL71}
  {$DEFINE DELPHI14}
  {$DEFINE DELPHI2010}
  {$DEFINE BCB14}
  {$DEFINE BCB2010}
  {$DEFINE BDS7}
  {$DEFINE BDS2010}
{$ENDIF}

{$IFDEF VER200}
  {$DEFINE COMPILER12}
  {$DEFINE VCL71}
  {$DEFINE DELPHI12}
  {$DEFINE DELPHI2009}
  {$DEFINE BCB12}
  {$DEFINE BCB2009}
  {$DEFINE BDS6}
  {$DEFINE BDS2009}
{$ENDIF}

{$IFDEF VER185}
  {$DEFINE COMPILER11}
  {$DEFINE VCL71}
  {$DEFINE DELPHI11}
  {$DEFINE DELPHI2007}
  {$DEFINE BCB11}
  {$DEFINE BCB2007}
  {$DEFINE BDS5}
  {$DEFINE BDS2007}
  {$UNDEF VER180}
{$ENDIF}

{$IFDEF VER180}
  {$DEFINE COMPILER10}
  {$DEFINE VCL71}
  {$DEFINE DELPHI10}
  {$DEFINE DELPHI2006}
  {$DEFINE BCB10}
  {$DEFINE BCB2006}
  {$DEFINE BDS4}
  {$DEFINE BDS2006}
{$ENDIF}

{$IFDEF VER170}
  {$DEFINE COMPILER9}
  {$DEFINE VCL71}
  {$DEFINE DELPHI9}
  {$DEFINE DELPHI2005}
  {$DEFINE BDS3}
  {$DEFINE BDS2005}
{$ENDIF}

{$IFDEF VER160}
  {$DEFINE COMPILER8}
  {$DEFINE VCL71}
  {$DEFINE DELPHI8}
  {$DEFINE BDS2}
{$ENDIF}

{$IFDEF VER150}
  {$DEFINE COMPILER7}
  {$IFDEF LINUX}
    {$DEFINE CLX10}
  {$ELSE}
    {$DEFINE VCL70}
    {$DEFINE CLX10}
    {$IFDEF BCB}
      {$DEFINE BCB7}
    {$ELSE}
      {$DEFINE DELPHI7}
    {$ENDIF}
  {$ENDIF}
{$ENDIF}

{$IFDEF VER140}
  {$DEFINE COMPILER6}
  {$IFDEF LINUX}
    {$DEFINE CLX10}
    {$IFDEF CONDITIONALEXPRESSIONS}
      {$IFDEF CompilerVersion}
        {$IF System.RTLVersion = 14.1}
          {$DEFINE KYLIX2}
        {$IFEND}
        {$IF System.RTLVersion = 14.5}
          {$DEFINE KYLIX3}
        {$IFEND}
      {$ELSE}
        {$DEFINE KYLIX1}
      {$ENDIF}
    {$ENDIF}
  {$ELSE}
    {$DEFINE VCL60}
    {$DEFINE CLX10}
    {$IFDEF BCB}
      {$DEFINE BCB6}
    {$ELSE}
      {$DEFINE DELPHI6}
    {$ENDIF}
  {$ENDIF}
{$ENDIF}

{$IFDEF VER130}
  {$DEFINE COMPILER5}
  {$DEFINE VCL50}
  {$IFDEF BCB}
    {$DEFINE BCB5}
  {$ELSE}
    {$DEFINE DELPHI5}
  {$ENDIF}
{$ENDIF}

{$IFDEF VER125}
  {$DEFINE COMPILER4}
  {$DEFINE VCL40}
  {$DEFINE BCB4}
{$ENDIF}

{$IFDEF VER120}
  {$DEFINE COMPILER4}
  {$DEFINE VCL40}
  {$DEFINE DELPHI4}
{$ENDIF}

{$IFDEF VER110}
  {$DEFINE COMPILER35}
  {$DEFINE VCL30}
  {$DEFINE BCB3}
{$ENDIF}

{$IFDEF VER100}
  {$DEFINE COMPILER3}
  {$DEFINE VCL30}
  {$DEFINE DELPHI3}
{$ENDIF}

{$IFDEF VER93}
  {$DEFINE COMPILER2}
  {$DEFINE VCL20}
  {$DEFINE BCB1}
{$ENDIF}

{$IFDEF VER90}
  {$DEFINE COMPILER2}
  {$DEFINE VCL20}
  {$DEFINE DELPHI2}
{$ENDIF}

{$IFDEF VER80}
  {$DEFINE COMPILER1}
  {$DEFINE VCL10}
  {$DEFINE DELPHI1}
{$ENDIF}

// DELPHIX_UP from DELPHIX mappings

{$IFDEF DELPHI29}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI29_UP}
  {$DEFINE DELPHI28_UP}
  {$DEFINE DELPHI27_UP}
  {$DEFINE DELPHI26_UP}
  {$DEFINE DELPHI25_UP}
  {$DEFINE DELPHI24_UP}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI120_ATHENS}
  {$DEFINE DELPHI120_ATHENS_UP}
  {$DEFINE DELPHI110_ALEXANDRIA_UP}
  {$DEFINE DELPHI104_SYDNEY_UP}
  {$DEFINE DELPHI103_RIO_UP}
  {$DEFINE DELPHI102_TOKYO_UP}
  {$DEFINE DELPHI101_BERLIN_UP}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI28}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI28_UP}
  {$DEFINE DELPHI27_UP}
  {$DEFINE DELPHI26_UP}
  {$DEFINE DELPHI25_UP}
  {$DEFINE DELPHI24_UP}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI110_ALEXANDRIA}
  {$DEFINE DELPHI110_ALEXANDRIA_UP}
  {$DEFINE DELPHI104_SYDNEY_UP}
  {$DEFINE DELPHI103_RIO_UP}
  {$DEFINE DELPHI102_TOKYO_UP}
  {$DEFINE DELPHI101_BERLIN_UP}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI27}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI27_UP}
  {$DEFINE DELPHI26_UP}
  {$DEFINE DELPHI25_UP}
  {$DEFINE DELPHI24_UP}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI104_SYDNEY}
  {$DEFINE DELPHI104_SYDNEY_UP}
  {$DEFINE DELPHI103_RIO_UP}
  {$DEFINE DELPHI102_TOKYO_UP}
  {$DEFINE DELPHI101_BERLIN_UP}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI26}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI26_UP}
  {$DEFINE DELPHI25_UP}
  {$DEFINE DELPHI24_UP}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI103_RIO}
  {$DEFINE DELPHI103_RIO_UP}
  {$DEFINE DELPHI102_TOKYO_UP}
  {$DEFINE DELPHI101_BERLIN_UP}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI25}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI25_UP}
  {$DEFINE DELPHI24_UP}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI102_TOKYO}
  {$DEFINE DELPHI102_TOKYO_UP}
  {$DEFINE DELPHI101_BERLIN_UP}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI24}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI24_UP}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI101_BERLIN}
  {$DEFINE DELPHI101_BERLIN_UP}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI23}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI23_UP}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI10_SEATTLE}
  {$DEFINE DELPHI10_SEATTLE_UP}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI22}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI22_UP}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE8}
  {$DEFINE DELPHIXE8_UP}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI21}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI21_UP}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE7}
  {$DEFINE DELPHIXE7_UP}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI20}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI20_UP}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE6}
  {$DEFINE DELPHIXE6_UP}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI19}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI19_UP}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE5}
  {$DEFINE DELPHIXE5_UP}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI18}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI18_UP}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE4}
  {$DEFINE DELPHIXE4_UP}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}

  // NO DELPHI2014 defined, so need define below here.
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI17}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI17_UP}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE3}
  {$DEFINE DELPHIXE3_UP}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}
{$ENDIF}

{$IFDEF DELPHI2013}
  {$DEFINE DELPHI2013_UP}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI16}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI16_UP}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE2}
  {$DEFINE DELPHIXE2_UP}
  {$DEFINE DELPHIXE_UP}
{$ENDIF}

{$IFDEF DELPHI2012}
  {$DEFINE DELPHI2012_UP}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI15}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHIXE}
  {$DEFINE DELPHIXE_UP}
{$ENDIF}

{$IFDEF DELPHI2011}
  {$DEFINE DELPHI2011_UP}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI14}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI2010}
  {$DEFINE DELPHI2010_UP}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI12}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI2009}
  {$DEFINE DELPHI2009_UP}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI11}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI2007}
  {$DEFINE DELPHI2007_UP}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI10}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI2006}
  {$DEFINE DELPHI2006_UP}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI9}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI2005}
  {$DEFINE DELPHI2005_UP}
{$ENDIF}

{$IFDEF DELPHI8}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI8_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI7}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI6}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI5}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI4}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI3}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI2}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF DELPHI1}
  {$DEFINE DELPHI}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

// BCBX_UP from BCBX mappings

{$IFDEF BCB29}
  {$DEFINE BCB}
  {$DEFINE BCB29_UP}
  {$DEFINE BCB28_UP}
  {$DEFINE BCB27_UP}
  {$DEFINE BCB26_UP}
  {$DEFINE BCB25_UP}
  {$DEFINE BCB24_UP}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB120_ATHENS}
  {$DEFINE BCB120_ATHENS_UP}
  {$DEFINE BCB110_ALEXANDRIA_UP}
  {$DEFINE BCB104_SYDNEY_UP}
  {$DEFINE BCB103_RIO_UP}
  {$DEFINE BCB102_TOKYO_UP}
  {$DEFINE BCB101_BERLIN_UP}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB28}
  {$DEFINE BCB}
  {$DEFINE BCB28_UP}
  {$DEFINE BCB27_UP}
  {$DEFINE BCB26_UP}
  {$DEFINE BCB25_UP}
  {$DEFINE BCB24_UP}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB110_ALEXANDRIA}
  {$DEFINE BCB110_ALEXANDRIA_UP}
  {$DEFINE BCB104_SYDNEY_UP}
  {$DEFINE BCB103_RIO_UP}
  {$DEFINE BCB102_TOKYO_UP}
  {$DEFINE BCB101_BERLIN_UP}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB27}
  {$DEFINE BCB}
  {$DEFINE BCB27_UP}
  {$DEFINE BCB26_UP}
  {$DEFINE BCB25_UP}
  {$DEFINE BCB24_UP}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB104_SYDNEY}
  {$DEFINE BCB104_SYDNEY_UP}
  {$DEFINE BCB103_RIO_UP}
  {$DEFINE BCB102_TOKYO_UP}
  {$DEFINE BCB101_BERLIN_UP}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB26}
  {$DEFINE BCB}
  {$DEFINE BCB26_UP}
  {$DEFINE BCB25_UP}
  {$DEFINE BCB24_UP}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB103_RIO}
  {$DEFINE BCB103_RIO_UP}
  {$DEFINE BCB102_TOKYO_UP}
  {$DEFINE BCB101_BERLIN_UP}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB25}
  {$DEFINE BCB}
  {$DEFINE BCB25_UP}
  {$DEFINE BCB24_UP}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB102_TOKYO}
  {$DEFINE BCB102_TOKYO_UP}
  {$DEFINE BCB101_BERLIN_UP}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}


{$IFDEF BCB24}
  {$DEFINE BCB}
  {$DEFINE BCB24_UP}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB101_BERLIN}
  {$DEFINE BCB101_BERLIN_UP}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB23}
  {$DEFINE BCB}
  {$DEFINE BCB23_UP}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB10_SEATTLE}
  {$DEFINE BCB10_SEATTLE_UP}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB22}
  {$DEFINE BCB}
  {$DEFINE BCB22_UP}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE8}
  {$DEFINE BCBXE8_UP}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB21}
  {$DEFINE BCB}
  {$DEFINE BCB21_UP}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE7}
  {$DEFINE BCBXE7_UP}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB20}
  {$DEFINE BCB}
  {$DEFINE BCB20_UP}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE6}
  {$DEFINE BCBXE6_UP}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB19}
  {$DEFINE BCB}
  {$DEFINE BCB19_UP}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE5}
  {$DEFINE BCBXE5_UP}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB18}
  {$DEFINE BCB}
  {$DEFINE BCB18_UP}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE4}
  {$DEFINE BCBXE4_UP}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}

  // NO BCB2014 defined, so need define below here.
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB17}
  {$DEFINE BCB}
  {$DEFINE BCB17_UP}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE3}
  {$DEFINE BCBXE3_UP}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}
{$ENDIF}

{$IFDEF BCB2013}
  {$DEFINE BCB2013_UP}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB16}
  {$DEFINE BCB}
  {$DEFINE BCB16_UP}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE2}
  {$DEFINE BCBXE2_UP}
  {$DEFINE BCBXE_UP}
{$ENDIF}

{$IFDEF BCB2012}
  {$DEFINE BCB2012_UP}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB15}
  {$DEFINE BCB}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCBXE}
  {$DEFINE BCBXE_UP}
{$ENDIF}

{$IFDEF BCB2011}
  {$DEFINE BCB2011_UP}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB14}
  {$DEFINE BCB}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB2010}
  {$DEFINE BCB2010_UP}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB12}
  {$DEFINE BCB}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB2009}
  {$DEFINE BCB2009_UP}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB11}
  {$DEFINE BCB}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB2007}
  {$DEFINE BCB2007_UP}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB10}
  {$DEFINE BCB}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB2006}
  {$DEFINE BCB2006_UP}
{$ENDIF}

{$IFDEF BCB7}
  {$DEFINE BCB}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB6}
  {$DEFINE BCB}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB5}
  {$DEFINE BCB}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB4}
  {$DEFINE BCB}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB3}
  {$DEFINE BCB}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

{$IFDEF BCB1}
  {$DEFINE BCB}
  {$DEFINE BCB1_UP}
{$ENDIF}

// KYLIXX_UP from KYLIXX mappings

{$IFDEF KYLIX3}
  {$DEFINE KYLIX}
  {$DEFINE KYLIX3_UP}
  {$DEFINE KYLIX2_UP}
  {$DEFINE KYLIX1_UP}
{$ENDIF}

{$IFDEF KYLIX2}
  {$DEFINE KYLIX}
  {$DEFINE KYLIX2_UP}
  {$DEFINE KYLIX1_UP}
{$ENDIF}

{$IFDEF KYLIX1}
  {$DEFINE KYLIX}
  {$DEFINE KYLIX1_UP}
{$ENDIF}

// BDSXX_UP from BDSXX mappings

{$IFDEF BDS23}      // 12.0 ATHENS
  {$DEFINE BDS}
  {$DEFINE BDS23_UP}
  {$DEFINE BDS22_UP}
  {$DEFINE BDS21_UP}
  {$DEFINE BDS20_UP}
  {$DEFINE BDS19_UP}
  {$DEFINE BDS18_UP}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS22}      // 11.0 ALEXANDRIA
  {$DEFINE BDS}
  {$DEFINE BDS22_UP}
  {$DEFINE BDS21_UP}
  {$DEFINE BDS20_UP}
  {$DEFINE BDS19_UP}
  {$DEFINE BDS18_UP}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS21}      // 10.4 SYDNEY
  {$DEFINE BDS}
  {$DEFINE BDS21_UP}
  {$DEFINE BDS20_UP}
  {$DEFINE BDS19_UP}
  {$DEFINE BDS18_UP}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS20}      // 10.3 RIO
  {$DEFINE BDS}
  {$DEFINE BDS20_UP}
  {$DEFINE BDS19_UP}
  {$DEFINE BDS18_UP}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS19}      // 10.2 Tokyo
  {$DEFINE BDS}
  {$DEFINE BDS19_UP}
  {$DEFINE BDS18_UP}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS18}      // 10.1 Berlin
  {$DEFINE BDS}
  {$DEFINE BDS18_UP}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS17}      // 10 Seattle
  {$DEFINE BDS}
  {$DEFINE BDS17_UP}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS16}
  {$DEFINE BDS}
  {$DEFINE BDS16_UP}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS15}
  {$DEFINE BDS}
  {$DEFINE BDS15_UP}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS14}
  {$DEFINE BDS}
  {$DEFINE BDS14_UP}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS12}
  {$DEFINE BDS}
  {$DEFINE BDS12_UP}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS11}
  {$DEFINE BDS}
  {$DEFINE BDS11_UP}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}

  // NO BDS2014 defined, so need define below here.
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS10}
  {$DEFINE BDS}
  {$DEFINE BDS10_UP}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2013}
  {$DEFINE BDS2013_UP}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS9}
  {$DEFINE BDS}
  {$DEFINE BDS9_UP}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2012}
  {$DEFINE BDS2012_UP}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS8}
  {$DEFINE BDS}
  {$DEFINE BDS8_UP}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2011}
  {$DEFINE BDS2011_UP}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS7}
  {$DEFINE BDS}
  {$DEFINE BDS7_UP}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2010}
  {$DEFINE BDS2010_UP}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS6}
  {$DEFINE BDS}
  {$DEFINE BDS6_UP}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2009}
  {$DEFINE BDS2009_UP}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS5}
  {$DEFINE BDS}
  {$DEFINE BDS5_UP}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2007}
  {$DEFINE BDS2007_UP}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS4}
  {$DEFINE BDS}
  {$DEFINE BDS4_UP}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2006}
  {$DEFINE BDS2006_UP}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS3}
  {$DEFINE BDS}
  {$DEFINE BDS3_UP}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS2005}
  {$DEFINE BDS2005_UP}
{$ENDIF}

{$IFDEF BDS2}
  {$DEFINE BDS}
  {$DEFINE BDS2_UP}
  {$DEFINE BDS1_UP}
{$ENDIF}

{$IFDEF BDS1}
  {$DEFINE BDS}
  {$DEFINE BDS1_UP}
{$ENDIF}

// COMPILERX_UP from COMPILERX mappings

{$IFDEF COMPILER29}      // 12.0 ATHENS
  {$DEFINE COMPILER29_UP}
  {$DEFINE COMPILER28_UP}
  {$DEFINE COMPILER27_UP}
  {$DEFINE COMPILER26_UP}
  {$DEFINE COMPILER25_UP}
  {$DEFINE COMPILER24_UP}
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER28}      // 11.0 ALEXANDRIA
  {$DEFINE COMPILER28_UP}
  {$DEFINE COMPILER27_UP}
  {$DEFINE COMPILER26_UP}
  {$DEFINE COMPILER25_UP}
  {$DEFINE COMPILER24_UP}
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER27}      // 10.4 SYDNEY
  {$DEFINE COMPILER27_UP}
  {$DEFINE COMPILER26_UP}
  {$DEFINE COMPILER25_UP}
  {$DEFINE COMPILER24_UP}
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER26}      // 10.3 RIO
  {$DEFINE COMPILER26_UP}
  {$DEFINE COMPILER25_UP}
  {$DEFINE COMPILER24_UP}
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER25}      // 10.2 Tokyo
  {$DEFINE COMPILER25_UP}
  {$DEFINE COMPILER24_UP}
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER24}      // 10.1 Berlin
  {$DEFINE COMPILER24_UP}
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER23}      // 10 Seattle
  {$DEFINE COMPILER23_UP}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER22}
  {$DEFINE COMPILER22_UP}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER21}
  {$DEFINE COMPILER21_UP}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER20}
  {$DEFINE COMPILER20_UP}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER19}
  {$DEFINE COMPILER19_UP}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER18}
  {$DEFINE COMPILER18_UP}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER17}
  {$DEFINE COMPILER17_UP}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER16}
  {$DEFINE COMPILER16_UP}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER15}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER14}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER12}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER11}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER10}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER9}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER8}
  {$DEFINE COMPILER8_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER7}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER6}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER5}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER4}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER35}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER3}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER2}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF COMPILER1}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

// VCLXX_UP from VCLXX mappings

{$IFDEF UCL10}
  {$DEFINE UCL10_UP}
{$ENDIF}

{$IFDEF VCL71}
  {$DEFINE VCL71_UP}
  {$DEFINE VCL70_UP}
  {$DEFINE VCL60_UP}
  {$DEFINE VCL50_UP}
  {$DEFINE VCL40_UP}
  {$DEFINE VCL30_UP}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL70}
  {$DEFINE VCL70_UP}
  {$DEFINE VCL60_UP}
  {$DEFINE VCL50_UP}
  {$DEFINE VCL40_UP}
  {$DEFINE VCL30_UP}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL60}
  {$DEFINE VCL60_UP}
  {$DEFINE VCL50_UP}
  {$DEFINE VCL40_UP}
  {$DEFINE VCL30_UP}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL50}
  {$DEFINE VCL50_UP}
  {$DEFINE VCL40_UP}
  {$DEFINE VCL30_UP}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL40}
  {$DEFINE VCL40_UP}
  {$DEFINE VCL30_UP}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL30}
  {$DEFINE VCL30_UP}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL20}
  {$DEFINE VCL20_UP}
  {$DEFINE VCL10_UP}
{$ENDIF}

{$IFDEF VCL10}
  {$DEFINE VCL10_UP}
{$ENDIF}

// CLXXX_UP from CLXXX mappings

{$IFDEF CLX10}
  {$DEFINE CLX10_UP}
{$ENDIF}

//==============================================================================
// 交叉平台相关定义
//==============================================================================

{$IFDEF COMPILER1}
  {$DEFINE WIN16}
  {$DEFINE MSWINDOWS}
{$ENDIF}

{$IFDEF BDS}
  {$DEFINE DOTNET}
{$ENDIF}

{$IFDEF WIN32}
  {$DEFINE MSWINDOWS}
{$ENDIF}

{$IFDEF LINUX}
  {$DEFINE UNIX}
  {$DEFINE COMPLIB_CLX}
{$ENDIF}

{$IFNDEF COMPLIB_CLX}
  {$DEFINE COMPLIB_VCL}
{$ENDIF}

//==============================================================================
// 映射版本信息到更友好的指令
//==============================================================================

{$IFDEF DELPHI}
  {$DEFINE SUPPORT_PASCAL}
{$ENDIF}

{$IFDEF BCB}
  {$DEFINE SUPPORT_PASCAL}
  {$DEFINE SUPPORT_CPLUSPLUS}
{$ENDIF}

{$IFDEF DELPHI120_ATHENS_UP}
  {$DEFINE LIST_INDEX_NATIVEINT}        // Athens 12 TList use NativeInt for Index and Count instead of Integer
  {$DEFINE IDE_HAS_TABMENU_COPY_PATH}   // Athens 12 editor tab menu has item to copy path or filename
  {$DEFINE IDE_HAS_DBCLICK_HIGHLIGHT}   // Athens 12 editor double click selection highlight
{$ENDIF}

{$IFDEF DELPHI110_ALEXANDRIA_UP}
  {$DEFINE NO_OLDCREATEORDER}           // Alexandria 11 removed OldCreateOrder
  {$DEFINE IDE_SUPPORT_HDPI}            // Alexandria 11 supports HDPI using TVirtualImageList, etc.
  {$DEFINE IDE_HAS_AUTO_READONLY}       // Alexandria 11 supports auto open VCL source readonly
  {$DEFINE IDE_HAS_MEMORY_VISUALIZAER}  // Alexandria 11 has Memory Visualizer for Debug
  {$DEFINE TSTRINGS_SETTEXTSTR_CANNULL} // Alexandria 11 TStrings.SetTextStr Ignore #0 Terminated Char
  {$DEFINE MEMORYSTREAM_CAPACITY_NATIVEINT}  // Alexandria 11 TMemoryStream Capacity is NativeInt instead of Longint
{$ENDIF}

{$IFDEF DELPHI104_SYDNEY_UP}
  {$DEFINE IDE_SUPPORT_LSP}             // Sydney 10.4 或以上支持 LSP 语言服务器
  {$DEFINE IDE_HAS_ERRORINSIGHT}        // Sydney 10.4.2 或以上支持编辑器侧栏的 ErrorInsight
  {$DEFINE IDE_SWITCH_BUG}              // Sydney 10.4.2 存在打开文件时莫名其妙切换到后台的 Bug
{$ENDIF}

{$IFDEF DELPHI103_RIO_UP}
  {$DEFINE SUPPORT_MACOS64}             // Rio 10.3.2 或以上支持 64 位 MacOS
{$ENDIF}

{$IFDEF DELPHI102_TOKYO_UP}
  {$DEFINE SUPPORT_LINUX64}             // Tokyo 10.2 或以上支持 Linux 64 位 Server
  {$DEFINE IDE_SUPPORT_THEMING}         // Tokyo 10.2.2 或以上支持 IDE 主题切换
{$ENDIF}

{$IFDEF DELPHI101_BERLIN_UP}
  {$DEFINE IDE_NEW_EMBEDDED_DESIGNER}   // 101B Re-opens "Embedded Designer" Option and Gives a New Container.
{$ENDIF}

{$IFDEF DELPHI10_SEATTLE_UP}
  {$DEFINE IDE_HAS_OWN_STRUCTUAL_HIGHLIGHT}  // 10S has own Structual Highlight
  {$DEFINE IDE_HAS_HIDE_NONVISUAL}      // 10S has "Hide Nonvisual" Feature.
{$ENDIF}

{$IFDEF DELPHIXE8_UP}
  {$DEFINE INIFILE_READWRITE_INTEGER}   // XE8 的 IniFile 的 ReadInteger 和 WriteInteger 参数开始由 LongInt 改为 Integer
  {$DEFINE IDE_INTEGRATE_CASTALIA}      // XE8/10S and above integrate Castalia.
{$ENDIF}

{$IFDEF COMPILER21_UP}                  // COMPILER21 = XE7
  {$DEFINE NOT_SUPPORT_BDE}             // 不集成 BDE 了
{$ENDIF}

{$IFDEF DELPHIXE7_UP}
  {$DEFINE SUPPORT_TBYTES_OPERATION}    // XE7 的 TBytes 开始支持相加、插入等操作
  {$DEFINE FMX_CONTROL_HAS_SIZE}        // XE7 的 FMX 的 Control 才有 Size 属性
{$ENDIF}

{$IFDEF DELPHIXE6_UP}
  {$DEFINE SUPPORT_JSON}                // XE6 有 System.JSON 库，不考虑 DBX/REST 等
{$ENDIF}

{$IFDEF DELPHIXE5_UP}
  {$DEFINE SUPPORT_MOBILE}              // XE5 开始支持移动开发
  {$DEFINE IDE_HAS_INSIGHT}             // XE5 has IDE Insight Bar
{$ENDIF}

{$IFDEF DELPHIXE4_UP}
  {$IFNDEF DISABLE_FMX}
    {$DEFINE SUPPORT_FMX_FRAME}         // XE4 FMX Supports FMX Frame
  {$ENDIF}
{$ELSE}
  {$DEFINE MEMO_CARETPOS_BUG}           // Memo CaretPos Get Negative Error Value for Large File under XE3 or below
{$ENDIF}

{$IFDEF DELPHIXE3_UP}
  {$DEFINE SUPPORT_ATOMIC}              // XE3 has Atomic Routines
  {$DEFINE TCONTROL_HAS_STYLEELEMENTS}  // XE3 TControl has StyleElements Property
  {$DEFINE IDE_NP_FMX_DESIGN_BUG}       // XE3 FMX Designer Cut/Copy/Paste cause AV Bug for -np switch
{$ENDIF}

{$IFDEF DELPHIXE2_UP}
  {$DEFINE SUPPORT_WIN64}                      // XE2 Supports Win64
  {$DEFINE SUPPORT_MACOS32}                    // XE2 Supports MacOS 32
  {$DEFINE SUPPORT_UNITNAME_DOT}
  {$DEFINE SUPPORT_ENHANCED_INDEXEDPROPERTY}   // XE2 New RTTI Supports IndexedProperty
  {$DEFINE SUPPORT_ZLIB_WINDOWBITS}            // XE2 ZLib Supports WindowBits
  {$DEFINE SUPPORT_GDIPLUS}                    // XE2 Supports GDI+
  {$DEFINE SUPPORT_INT64ARRAY}                 // XE2 Defined Int64Array
  {$DEFINE SUPPORT_ALPHACOLOR}                 // XE2 System.UITypes Has TAlphaColors
{$ENDIF}

{$IFDEF DELPHIXE_UP}
  {$DEFINE TSTRINGS_HAS_WRITEBOM}              // XE TStrings has WriteBOM property.
  {$DEFINE IDE_HAS_DEBUGGERVISUALIZER}         // XE ToolsAPI has Debugger Visualizer Interfaces.
  {$DEFINE IDE_HAS_STRINGS_VISUALIZAER}        // XE has TStrings Visualizer for Debug
{$ENDIF}

{$IFDEF BDS2012_UP}                        // 2012 = XE2
  {$DEFINE SUPPORT_32_AND_64}              // XE2 Support Win32 and Win64
  {$IFNDEF DISABLE_FMX}
    {$DEFINE SUPPORT_FMX}
  {$ENDIF}
  {$DEFINE SUPPORT_CROSS_PLATFORM}         // XE2 支持跨平台
  {$DEFINE VERSIONINFO_PER_CONFIGURATION}  // Every Configuruation can have a Version Info.
  {$DEFINE OTA_ENVOPTIONS_PLATFORM_BUG}
    // A Bug Can't get Correct Env Option Values for Current Platform.
  {$DEFINE LIST_NEW_POINTER}
{$ENDIF}

{$IFDEF BDS2010_UP}
  {$DEFINE SUPPORT_INTERFACE_AS_OBJECT}
  {$DEFINE SUPPORT_ENHANCED_RTTI}          // New enhanced RTTI.
  {$DEFINE SUPPORT_EXTERNAL_DELAYED}       // External functions can be declared as 'delayed'.
  {$DEFINE SUPPORT_CLASS_CONSTRUCTOR}      // 2010 and above Supports class constructor and destructor
  {$DEFINE SUPPORT_CLASS_DESTRUCTOR}
  {$DEFINE OTA_DEBUG_HAS_EVENTS}           // 2010 下的 DebuggerService 有 ProcessDebugEvents
  {$DEFINE IDE_HAS_NEW_COMPONENT_PALETTE}  // IDE has a new style Component Palette.
  {$DEFINE IDE_HAS_EDITOR_SEARCHPANEL}     // Editor has a Search Panel
  {$DEFINE IDE_HAS_DATETIME_HINT}          // TDate/TTime/TDateTime shows Normally in Debug Hint
{$ENDIF}

{$IFDEF BDS2010}
  // 2010 下 EditView 设置 CursorPos 后调用 EditPosition.InsertText 会有列偏差
  {$DEFINE EDITVIEW_SETCURSORPOS_BUG}
{$ENDIF}

{$IFDEF BDS2009_UP}
  {$DEFINE UNICODE_STRING}
  {$DEFINE SUPPORT_ATTRIBUTE}                    // 支持 Attribute
  {$DEFINE SUPPORT_GENERIC}                      // 支持泛型
  {$DEFINE SUPPORT_ANSISTRING_CODEPAGE}          // AnsiString 的声明支持指定代码页
  {$DEFINE SUPPORT_ENCODING}                     // Unicode with TEncoding
  {$DEFINE SUPPORT_PUINT64}                      // Has Pointer of UInt64
  {$DEFINE OBJECT_HAS_TOSTRING}                  // TObject.ToString Function
  {$DEFINE OBJECT_HAS_EQUAL}                     // TObject.Equal Function
  {$DEFINE OBJECT_HAS_GETHASHCODE}               // TObject.GetHashCode Function
  {$DEFINE TGRAPHIC_SUPPORT_PARTIALTRANSPARENCY} // TGraphic 类支持 Alpha 通道透明
  {$DEFINE SUPPORT_OTA_PROJECT_CONFIGURATION}

  {$DEFINE IDE_MAINFORM_EAT_MOUSEWHEEL}
  // MainForm of 2009 or Above will eat Message in MouseWheelHandler
  {$DEFINE IDE_CODEINSIGHT_AUTOINVOKE}
  // IDE Code Insight has Auto Invoke Option
  {$DEFINE EDITVIEW_CONVERTPOS_BUG}
  // 2009 or Above IEditView.ConvertPos Incorrect when Meeting Unicode Chars.

  {$IFNDEF DELPHIXE2_UP}  // 2009/2010/XE has a Project Version Number Bug.
    {$DEFINE PROJECT_VERSION_NUMBER_BUG}
  {$ENDIF}
  {$DEFINE OTA_DPKOPTION_SETVALUE_CORRUPT_BUG}
  // A OpenTools API Bug IOTAProjectOptions.SetOptionValue under 2009 or above:
  // Set an Option Value to DPK Project Options maybe cause DPK Source Corrupt.
{$ELSE}
  {$DEFINE ZLIB_STREAM_NOSIZE}           // 2007 及以下的 Zlib 的解压缩流不支持 Size 操作
{$ENDIF}

{$IFDEF BDS2009}
  // 2009 下 CreateParams 中可能导致死循环
  {$DEFINE CREATE_PARAMS_BUG}
  // 2009 下 EditView 设置 CursorPos 后调用 EditPosition.InsertText 会有列偏差
  {$DEFINE EDITVIEW_SETCURSORPOS_BUG}
{$ENDIF}

{$IFDEF BDS2007_UP}
  {$DEFINE IDE_CONF_MANAGER}
  {$DEFINE TBYTES_DEFINED}               // 2007 Defined TBytes = array of Byte;
  {$DEFINE PROJECT_FILENAME_DPROJ}       // Project File is .dproj
{$ENDIF}

{$IFDEF BDS2007}
  // RAD Studio 2007 下开启 AutoComplete 会导致输入中文后退格乱码
  {$DEFINE COMBOBOX_CHS_BUG}
{$ENDIF}

{$IFDEF BDS2006_UP}
  {$DEFINE SUPPORT_CLASS_VAR}            // 2006 and above Supports class var
  {$DEFINE TCONTROL_HAS_MARGINS}         // 2006 and above TControl has Margins
  {$DEFINE TCONTROL_HAS_EXPLICIT_BOUNDS} // 2006 and above TControl has Explicit Bounds
  {$DEFINE TCONTROL_HAS_MOUSEENTERLEAVE} // 2006 and above TControl has Mouse Enter/Leave Events
  {$DEFINE OTA_CODE_TEMPLATE_API}        // 2006 and above Provides CodeTemplateAPI.
  {$DEFINE OTA_DEBUG_HAS_ERBUSY}         // 2006 下的 Evaluate 有返回值 erBusy
  {$DEFINE IDE_HAS_GUIDE_LINE}           // 2006 and above has Designer Guide Line
  {$DEFINE IDE_SYNC_EDIT_BLOCK}          // 2006 and above Editor Supports Sync Block Edit
  {$DEFINE EDITOR_TAB_ONLYFROM_WINCONTROL}
  // From BDS 2006 IDEGraident Editor Tab is Only From WinControl, not TabSet/TabControl
{$ENDIF}

{$IFDEF BDS2005_UP}
  {$DEFINE OTA_PALETTE_API}              // 2005 and above Provides PaletteAPI.
  {$DEFINE IDE_EDITOR_ELIDE}             // 2005 或以上编辑器支持折叠
  {$DEFINE IDE_FILE_HISTORY}             // 2005 或以上版本会存储文件历史版本
{$ENDIF}

{$IFDEF BDS2006}
  {$DEFINE PROJECT_FILENAME_BDSPROJ}     // Project File is .bdsproj
{$ENDIF}

{$IFDEF BDS2005}
  {$DEFINE PROJECT_FILENAME_BDSPROJ}     // Project File is .bdsproj
{$ENDIF}

{$IFDEF BDS}                             // 2005 及以上
  {$DEFINE SUPPORT_PASCAL}
  {$DEFINE SUPPORT_CSHARP}
  {$DEFINE SUPPORT_INLINE}
  {$DEFINE SUPPORT_UINT64}
  {$DEFINE IDE_WIDECONTROL}              // 2005 及以上的编辑器内部是宽字符串且输出 UTF-8，无论是否 Unicode 编译器
  {$DEFINE IDE_EDITOR_SUPPORT_FOLDING}   // 2005 及以上的编辑器支持区域折叠
  {$DEFINE OTA_NEW_BREAKPOINT_NOBUG}     // 2005 及以上的 NewBreakpoint 才能工作
  {$DEFINE IDE_ACTION_UPDATE_DELAY}      // IDE's Action Menu Update will Delay in 2005 or Up.
  {$DEFINE SUPPORT_WIDECHAR_IDENTIFIER}

  {$IFNDEF COMPILER12_UP}
    // 2005~2007 Compiler is Ansi but Editor String is UTF-8
    {$DEFINE IDE_STRING_ANSI_UTF8}
  {$ENDIF}
{$ENDIF}

{$IFDEF DELPHI7_UP}
  {$DEFINE SUPPORT_FORMAT_SETTINGS}       // Delphi 7 开始支持 FormatSettings
  {$DEFINE IDE_MENUBAR_VERTICAL_POSITION_BUG}
  // Delphi 7 及以上的 MenuBar 的竖直方向上的弹出位置计算错误，容易超出上界
  {$DEFINE IDE_MENUBAR_VERTICAL_NOSCROLL_BUG}
  // Delphi 7 及以上的 MenuBar 的竖直方向上数量超标时不会滚动
{$ENDIF}

{$IFDEF COMPILER6_UP}
  {$DEFINE SUPPORT_DEPRECATED}
{$ENDIF}

{$IFDEF COMPILER6_UP}
  {$DEFINE SUPPORT_ENUMVALUES}
  {$DEFINE SUPPORT_VARIANTS}
  {$DEFINE SUPPORT_IFDIRECTIVE}
{$ENDIF}

{$IFDEF DELPHI5_UP}
  {$IFNDEF BDS2005_UP}
    {$DEFINE PROJECT_FILENAME_DPR}       // Delphi 5/6/7 Project File is .dpr
  {$ENDIF}
{$ENDIF}

{$IFDEF COMPILER5}
  {$DEFINE TSTREAM_LONGINT}              // D6 或以上的 TStream 是 Int64
{$ENDIF}

{$IFDEF BCB5}
  {$DEFINE BCB5OR6}  // 定义一个 BCB5OR6 以方便 BCB5 或 BCB6 使用
{$ENDIF}

{$IFDEF BCB6}
  {$DEFINE BCB5OR6}
{$ENDIF}

{$IFDEF BCB5OR6}
  {$DEFINE NO_ZLIB}
{$ENDIF}

{$IFDEF DELPHI5}
  {$DEFINE DELPHI5OR6}  // 定义一个 DELPHI5OR6 以方便 DELPHI5 或 DELPHI6 使用
{$ENDIF}

{$IFDEF DELPHI6}
  {$DEFINE DELPHI5OR6}
{$ENDIF}

{$IFDEF COMPILER4_UP}
  {$DEFINE SUPPORT_INT64}
  {$DEFINE SUPPORT_DYNAMICARRAYS}
  {$DEFINE SUPPORT_DEFAULTPARAMS}
  {$DEFINE SUPPORT_REINTRODUCE}
  {$DEFINE SUPPORT_OVERLOAD}
{$ENDIF}

{$IFDEF COMPILER35_UP}
  {$DEFINE SUPPORT_EXTSYM}
  {$DEFINE SUPPORT_NODEFINE}
{$ENDIF}

{$IFDEF COMPILER3_UP}
  {$DEFINE SUPPORT_WIDESTRING}
  {$DEFINE SUPPORT_INTERFACE}
{$ENDIF}

{$IFDEF WIN64}
  {$DEFINE EXTENDED_SIZE_8}      // Win64 下 Extended 类型长度 8 字节
{$ENDIF}

{$IFDEF CPUARM}
  {$DEFINE EXTENDED_SIZE_8}      // ARM 平台 Extended 类型长度 8 字节
{$ENDIF}

{$IFDEF WIN32}
  {$DEFINE EXTENDED_SIZE_10}     // Win32 下 Extended 类型长度 10 字节
{$ENDIF}

{$IFDEF MACOS64}
  {$DEFINE EXTENDED_SIZE_16}     // MacOS64 下 Extended 类型长度 16 字节
{$ENDIF}

{$IFDEF LINUX64}
  {$DEFINE EXTENDED_SIZE_16}     // Linux64 下 Extended 类型长度 16 字节
{$ENDIF}

//==============================================================================
// 针对 PascalScript 的调试设置
//==============================================================================

{.$DEFINE ALLDEBUG} // 貌似不需要，先禁用

//==============================================================================
// 开发包语种定义
//==============================================================================

{$DEFINE GB2312}
{.$DEFINE BIG5}
{.$DEFINE ENGLISH}

//==============================================================================
// 下面的编译指令请勿更改
//==============================================================================

{$A+ Force alignment on word/dword boundaries}
{$S+ stack checking}

{$B- Short evaluation of boolean values}
{$H+ Long string support}
{$V- No var string checking}
{$X+ Extended syntax}
{$P+ Open string parameters}
{$J+ Writeable typed constants}
{$R- No Range checking}
{$OVERFLOWCHECKS OFF}

{$IFDEF COMPILER6_UP}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}

{$IFDEF COMPILER7_UP}
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
{$ENDIF}

{$IFDEF BCB}
  {$OBJEXPORTALL ON}
{$ENDIF}

{$DEFINE CN_USE_MSXML}

{$ENDIF FPC}

