/** Returns true if the OS is 64-bit, or false for a 32-bit OS. */
static bool isOperatingSystem64Bit();
Unfortunately it’s wildly inaccurate since none of the implementations agree with it, or with each other:
juce_SystemStats_mac.mmJUCE_IOS ? false : true
juce_SystemStats_windows.cppJUCE_64BIT, elseIsWow64Process()
juce_SystemStats_linux.cppJUCE_64BIT
juce_SystemStats_android.cppJUCE_64BIT
Which one is this function for?
- The build - what was the binary compiled for? (
JUCE_64BITalready answers this, so the function would be redundant) - The process - what is it running as right now? (differs from 1 only under Rosetta / Prism)
- The OS - is the kernel 64-bit? (basically what the comment says)
- The hardware - can the chip run 64-bit at all? (differs from 3 on embedded and set-top boxes)
Pick a number and I’ll do the work: implementation and testing, then open a PR. Note that “It’s 1 and the comment is wrong” is a completely fine answer - I’d just rather not guess.
Two of the current answers look wrong if the intent is 3:
- iOS returns
false, though every device since the 5s is 64-bit- and iOS 11 dropped 32-bit apps entirely.
IsWow64Processis documented to return FALSE “if the process is a 32-bit application running under 64-bit Windows 10 on ARM”- Microsoft’s own advice on that page being to use
IsWow64Process2instead.
- Microsoft’s own advice on that page being to use