Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++DelphiRAD Studio

RAD Studio 11 Alexandriaで変更されたプラットフォーム識別子

platformidentifiers

この記事は、David Intersimoneのブログの抄訳です

RAD Studio 11.0 Alexandriaの新機能のRTLで小さな変更があり、「プラットフォーム識別子」に新しいプラットフォーム識別子が追加されています。以下は、docwikiの抜粋です。

RTL では、macOS/Arm64 プラット用に、新しいプラットフォーム識別子、pidOSXArm64 が追加されています。既存の識別子 pidAndroid32Arm および pidAndroid64Arm は、新しい pidAndroidArm32 と pidAndroidArm64 に置き換わります。現在、すべてのプラットフォーム関連の識別子は、コンパイラの同じ形式と順番を使用しています: <プラットフォーム名> <アーキテクチャ名> <ビットネス>

プラットフォーム識別子自体は、RAD Studio 11.0よりも前のバージョンから利用できますが、この識別子を使用すると、クロスプラットフォーム開発のプロジェクトに便利です。またプラットフォームに関連するすべての識別子に一貫した命名パターンを使用することで、プログラミングにも役立ちます。

新しいプラットフォーム識別子は、System.Classes.pasおよびSystem.Classes.hppファイルに記述されております。なお、RAD Studio 11.0では、一部のプラットフォーム識別子は、deprecated(非推奨)属性になっていることにご注意ください。

platformidentifiers
platformidentifierscpp

C++Builderに関する注意点:従来のBorlandコンパイラ(bcc32)を使用してビルドすると、上図のスクリーンショットのようにメッセージウィンドウに非推奨の警告メッセージが表示されます。docWikiには、Clang拡張C++コンパイラや非推奨の属性を使用する際の回避策に関する説明があります。docwikiの説明には、”#pragma obsoleteを、deprecated 属性の回避策として使用することができる“と記載されてます。

System.Classes.pas
 
  { Platform identifiers }
  pidWin32          = $00000001;
  pidWin64          = $00000002;
  pidOSX32          = $00000004;
  pidiOSSimulator32 = $00000008;
  pidiOSSimulator   = pidiOSSimulator32 deprecated 'Use pidiOSSimulator32';
  pidAndroidArm32   = $00000010;
  pidAndroid32Arm   = pidAndroidArm32 deprecated 'Use pidAndroidArm32';
  pidAndroid        = pidAndroidArm32 deprecated 'Use pidAndroidArm32';
  pidLinux32        = $00000020;
  pidiOSDevice32    = $00000040;
  pidiOSDevice      = pidiOSDevice32 deprecated 'Use pidiOSDevice32';
  pidLinux64        = $00000080;
 
  pidWinNX32        = $00000100;
  pidWinIoT32       = $00000200; // Embedded IoT (Internet of Things) Windows w/ Intel Galileo
  pidiOSDevice64    = $00000400;
  pidWinARM32       = $00000800;
  pidWin32ARM       = pidWinARM32 deprecated 'Use pidWinARM32';
  pidOSX64          = $00001000;
  pidLinuxArm32     = $00002000;
  pidLinuxArm64     = $00004000;
  pidAndroidArm64   = $00008000;
  pidAndroid64Arm   = pidAndroidArm64 deprecated 'Use pidAndroidArm64';
 
  pidiOSSimulator64 = $00010000;
 
  pidOSXArm64       = $00020000;
  pidWinArm64       = $00040000;
  pidiOSSimulatorArm64 = $00080000;
 
  pidAllPlatforms = pidWin32 or pidWin64 or
                    pidOSX32 or pidOSX64 or pidOSXArm64 or
                    pidiOSDevice32 or pidiOSDevice64 or
                    pidiOSSimulator32 or pidiOSSimulator64 or
                    pidAndroidArm32 or pidAndroidArm64 or
                    pidLinux64;
 
  { Platform family identifiers }
  pfidWindows     = pidWin32 or pidWin64;
  pfidOSX         = pidOSX32 or pidOSX64 or pidOSXArm64;
  pfidiOS         = pidiOSDevice32 or pidiOSDevice64 or
                    pidiOSSimulator32 or pidiOSSimulator64;
  pfidAndroid     = pidAndroidArm32 or pidAndroidArm64;
  pfidLinux       = pidLinux64;
System.Classes.hpp
 
static const System::Int8 pidWin32 = System::Int8(0x1);
static const System::Int8 pidWin64 = System::Int8(0x2);
static const System::Int8 pidOSX32 = System::Int8(0x4);
static const System::Int8 pidiOSSimulator32 = System::Int8(0x8);
static const System::Int8 pidiOSSimulator _DEPRECATED_ATTRIBUTE1("Use pidiOSSimulator32")  = System::Int8(0x8);
static const System::Int8 pidAndroidArm32 = System::Int8(0x10);
static const System::Int8 pidAndroid32Arm _DEPRECATED_ATTRIBUTE1("Use pidAndroidArm32")  = System::Int8(0x10);
static const System::Int8 pidAndroid _DEPRECATED_ATTRIBUTE1("Use pidAndroidArm32")  = System::Int8(0x10);
static const System::Int8 pidLinux32 = System::Int8(0x20);
static const System::Int8 pidiOSDevice32 = System::Int8(0x40);
static const System::Int8 pidiOSDevice _DEPRECATED_ATTRIBUTE1("Use pidiOSDevice32")  = System::Int8(0x40);
static const System::Byte pidLinux64 = System::Byte(0x80);
static const System::Word pidWinNX32 = System::Word(0x100);
static const System::Word pidWinIoT32 = System::Word(0x200);
static const System::Word pidiOSDevice64 = System::Word(0x400);
static const System::Word pidWinARM32 = System::Word(0x800);
static const System::Word pidWin32ARM _DEPRECATED_ATTRIBUTE1("Use pidWinARM32")  = System::Word(0x800);
static const System::Word pidOSX64 = System::Word(0x1000);
static const System::Word pidLinuxArm32 = System::Word(0x2000);
static const System::Word pidLinuxArm64 = System::Word(0x4000);
static const System::Word pidAndroidArm64 = System::Word(0x8000);
static const System::Word pidAndroid64Arm _DEPRECATED_ATTRIBUTE1("Use pidAndroidArm64")  = System::Word(0x8000);
static const int pidiOSSimulator64 = int(0x10000);
static const int pidOSXArm64 = int(0x20000);
static const int pidWinArm64 = int(0x40000);
static const int pidiOSSimulatorArm64 = int(0x80000);
static const int pidAllPlatforms = int(0x394df);
static const System::Int8 pfidWindows = System::Int8(0x3);
static const int pfidOSX = int(0x21004);
static const int pfidiOS = int(0x10448);
static const System::Word pfidAndroid = System::Word(0x8010);
static const System::Byte pfidLinux = System::Byte(0x80)
Kai for RAD Studio is Now Available! Special Live Webinar: Introducing Kai - A New Chapter for RAD Studio RAD Studio 13.1 Florence Now Available

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.

Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES