In C# attributes (e.g. [DllImport]), you can only use const values, so it's not possible to use the OS singleton to check which platform you're using. So it would be very useful if a platform constant was available in the builds, so we can do something like #if WINDOWS with preprocessor directives.
If this does get added wouldn't it be useful to be precise on OS and bit info eg.:
@exts 32-bit macOS isn't supported anymore, so OS_OSX would be enough :slightly_smiling_face: (the platform is called OSX in the engine code).
This should also apply to REAL_T_IS_DOUBLE (if it's not already being passed).
Mac should probably be changed to OS_MAC since it's just called "macOS" now. But OS_MAC_64 is still relevant because there might be non-x64 Macs one day (ARM? 128-bit?).
Also, OS_UWP should probably exist too.
Maybe we could use the existing OS names? This way we would not have to maintain separate lists of OS names and new OS targets get added in automatically.
Something like "OS_" + uppercase(OS::get_singleton()->get_name()) + "_" + Bits maybe?
The OS singleton does not provide the number for Bits, it seems. Might want to add that in, too...
Not to forget a general "GODOT" define like suggested in #27227
Most helpful comment
If this does get added wouldn't it be useful to be precise on OS and bit info eg.:
OS_MAC_32OS_MAC_64