Talk:64-bit Windows Data Types Compared to 32-bit Windows Data Types
The chart mentions TExtended80Rec but not the new type Extended80.
Extended80 is a compatibility type introduced with Pulsar. Variables of this type are stored in the same way as 10-byte extended values but resolved in calculations as 8-byte double precision values. As described in the note, it provided as a means for 64-bit Delphi programs to work with 10-byte extended data from the 32-bit versions of Delphi.
Contents
Response
We did document Extended80 for the XE2 first release. However, Extended80 has now been designated as a hidden helper class or pseudo-type that is not intended for customer use, so the documentation has been reduced to "For internal use only."
KrisHouser 16:48, 30 November 2011 (PST)
C++
Please add the following section for C++
Go Up to 64-bit Cross-Platform Application Development for Windows
The following tables summarize the differences and similarities between 64-bit OS data types and 32-bit OS data types.
C++Builder 32-bit and 64-bit Windows built-in type sizes
Integral types
On Win64, System::NativeInt/ssize_t is twice the size of the Win32 System::NativeInt/ssize_t, and System::NativeUInt is twice the size of the Win32 System::NativeUInt/size_t.
Signed Integer |
Unsigned Integer |
C++/32 |
C++/64 |
Comments |
---|---|---|---|---|
signed char |
System::Byte, unsigned char |
1 byte |
||
System::Smallint, short |
System::Word, unsigned short |
2 bytes |
||
System::LongInt, signed long |
System::LongWord, unsigned |
4 bytes |
||
System::Integer, int |
System::Cardinal, unsigned int |
4 bytes |
||
System::Int64, __int64, long long |
System::UInt64, unsigned __int64, unsigned long long |
8 bytes |
||
System::NativeInt, ssize_t |
System::NativeUInt, size_t |
4 bytes |
8 bytes |
Pointer types
On 64-bit Windows, all pointer types are 8 bytes, twice the size on 32-bit Windows.
Pointer types |
C++/32 |
C++/64 |
---|---|---|
System::Pointer, void* |
4 bytes |
8 bytes |
System::String, System::UnicodeString | ||
System::TObject | ||
System::TClass | ||
System::IInterface, System::DelphiInterface | ||
System::AnsiString, System::AnsiStringT<code-page> | ||
System::WideString | ||
System::UnicodeString | ||
System::DynamicArray | ||
System::PAnsiChar | ||
System::PWideChar | ||
System::PChar |
__closure
On 64-bit Windows, the alignment for a __closure is 16 bytes, twice the size on 32-bit Windows.
__closure | 8 bytes | 16 bytes |
Floating-point types (including the Extended data type)
The Extended type has 2 bytes' worth less precision on 64-bit Windows.
For more information, see The Extended Data Type Is 2 Bytes Smaller on 64-bit Windows Systems.
Floating point types |
C++/32 |
C++/64 |
Comments |
---|---|---|---|
System::Single, float |
4 bytes |
||
System::Double, double |
8 bytes |
||
System::Extended, long double |
10 bytes |
8 bytes |
TExtended80Rec has 10 bytes on Win64 |
Real48 |
Not Supported |
||
System::Comp |
8 bytes |
||
System::Currency |
8 bytes |
Other types
On Win64, file size has increased.
Other types |
C++/32 |
C++/64 |
Comments |
---|---|---|---|
System::Boolean, bool |
1 byte |
||
System::ByteBool, unsigned char |
1 byte |
||
System::WordBool, unsigned short |
2 bytes |
||
System::LongBool, unsigned int |
4 bytes |
||
System::AnsiChar, char |
1 byte |
||
System::WideChar, wchart_t |
2 bytes |
||
System::Char, wchar_t (Windows), char16_t (OSX) |
2 bytes |
||
System::ShortString |
256 bytes |
||
System::Variant/System::OleVariant |
16 bytes |
24 bytes |
Constants
Constants |
C++/32 |
C++/64 |
---|---|---|
MaxInt |
$7fffffff | |
MaxLongInt |
$7fffffff |