Is it just me, or is this just an extremely convoluted way of doing things?
I know it says it is a trick, but I'm not sure I completely get it.
I know it says it is a trick, but I'm not sure I completely get it.
Yes, coding like this is evil and will eat your hamster. For example, trying to have a variable named "platform" will break your code in strange ways. And before you say "but it's C++, it's modern", CppCoreGuidelines explicitly say this is bad and that one should favor #ifdefs. (https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...)
There have to be some kind of "-DPLATFORM=arm" definition, one have to tell to the compiler in some way what hardware we are running on...