I don’t have an ARM64 device to test on, and the docs don’t say.
i believe this flag is ONLY true when you build for ARM64, which currently is not possible (yet).
ARM64 is 64-bit.
And ARM 64-bit is uses for iOS and Apple Silicon on MacOS.
Linux ARM 64-bit is coming in future.
Thanks. Just to confirm I understand, the Target64Bit
constant is true when building or running an ARM64-based app?
Yes.
If you need to know specifically that it’s ARM64 you would need
#if TargetARM and Target64Bit then
I think I only need to know whether I’m on 64-bit. A user on ARM64 reported a bug in my libcurl binding, and I’m trying to eliminate possible causes (such as using the wrong integer size).
As far as i know these are BUILD constants so they only apply for the actual build they do not know the system value since they are compile time constants.
Target64Bit = True when the build was made for 64-bit systems.
The docs say “Indicates when your application has been compiled as a 64-bit executable.”
So for example you run Linux ARM32 bit executable build in xojo Target64Bit should be False.
You can verify this by making a test build.
Weird results in interplatform libs are usually related to 3 components: word size (16, 32, 64bit…), endianness (byte ordering), and data alignment when dealing with structured data. Both caller and lib must follow and expect the same behavior and structure alignments.
That’s what prompted my question. I use Target64Bit
/Target32Bit
to determine what word size, etc. and it works fine for x86 and x86_64 builds. So it occurred to me that maybe Target64Bit
was false on ARM64 (IDK why it would be, but then again IDK much about ARM), which might account for the bug I’m working on.