FastMM4BCB.cpp does not compile in XE2+ 64bit
Brought to you by:
pierre_le_riche
When compiling FastMM 4.991 in C++Builder 64-bit, FastMM4BCB.cpp produces compiler errors when DetectMMOperationsAfterUninstall is enabled:
[bcc64 Error] FastMM4BCB.cpp(2024): assigning to 'GetMemFunc' (aka 'void *(*)(int) __attribute__((fastcall))') from incompatible type 'void *(*)(NativeInt) __attribute__((fastcall))': type mismatch at 1st parameter ('int' vs 'NativeInt' (aka 'long long'))
[bcc64 Error] FastMM4BCB.cpp(2026): assigning to 'ReallocMemFunc' (aka 'void *(*)(void *, int) __attribute__((fastcall))') from incompatible type 'void *(*)(void *, NativeInt) __attribute__((fastcall))': type mismatch at 2nd parameter ('int' vs 'NativeInt' (aka 'long long'))
I think similar errors might also occur on lines 1858 and 1860 if PURE_CPLUSPLUS and PatchBCBTerminate are undefined, too.
On lines 160 and 162, GetMemFunc and ReallocMemFunc are declared to take int parameters ( and on line 165, AllocMemFunc is declared to take an unsigned parameter). In XE2+, they need to take NativeInt parameters instead.
Small correction - 64-bit was added to C++Builder in XE3 Update 1, not in XE2. However, the memory manager functions do use NativeInt in XE2, so please make sure FastMM4.pas is handling that correctly, a least.