Delphi 64-bit コンパイラに関する情報を紹介する動画が日本語字幕付きで公開されています。

Delphi 64-bit コンパイラに関する情報を紹介する動画が日本語字幕付きで公開されています。

気になったポイントをまとめてみました。

データ型の比較

データ型 Delphi/32 Delphi/64
ShortInt 1 byte
SmallInt 2 bytes
LongInt 4 bytes
Integer 4 bytes
Int64 8 bytes
Byte 1 byte
Word 2 bytes
LongWord 4 bytes
Cardinal 4 bytes
UInt64 8 bytes
NativeInt 4 bytes 8 bytes
NativeUInt 4 bytes 8 bytes
all pointers
 Pointer
 String
 Class instance
 Clas reference
 Interface
 AnsiString
 WideString
 UnicodeString
 Procedure pointer
 Dynamic array
 PAnsiChar
 PWideChar
 PChar
4 bytes 8 bytes
Dynamic Arrays 32-bit indexing 64-bit indexing
Floating point math Float(?) Double

新しい定義済みの条件

Category Identifier dcc32 dcc64
Platform MSWINDOWS defined defined
WIN32 defined not defined
WIN64 not defined defined
CPU CPU386 defined not defined
CPUX86 defined not defined
CPUX64 not defined defined
Availability ASSEMBLER defined defined
UNICODE defined defined

64-bitに移行するときの注意点

  • PinterとIntegerのサイズが異なる。キャストするときはサイズを仮定しないこと。
  • 外部DLL、ランタイムパッケージファイル、サーとバーティコンポーネント、ActiveXコントロールなどすべてのコードを64-bitに統一する
  • 32-bit Windowsの古い呼び出し規約(register,cdecl,stdcall)はコンパイラによって無視される
  • ポインタ-演算に注意する。ポインターサイズを仮定していることは確認が必要。
  • Windows APIの引数や戻り値のデータがに注意。
  • Pascalコードや関数内のアセンブラはPure Pascalで書き直すことを推奨。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください