3 ms·
It is. The page starts with talk about namespaces and such, so one thinks this will be about some cool new features of C++11, but instead ends with a global #de
by Noughmad 11y ago
It is. The page starts with talk about namespaces and such, so one thinks this will be about some cool new features of C++11, but instead ends with a global #define.
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/CppCoreGuidelines.md#es30-dont-use-macros-for-program-text-manipulation https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...)
- dchichkov 11y agoauthor Yes, "PLATFORM" should be clearly marked with uppercase. Fixed. Thank you. 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...