In MSVC and C # #pragma regioncan be used to indicate a section of code.
Similarly, in GCC / Clang, it #pragma markcan do the same thing.
Is it possible to define a single macro, such as one CODELABEL(label), that will work for both compilers?
Basically, I would like to not do the following:
#ifdef _WIN32
#pragma region Variables
#else
#pragma mark Variables
#endif
bool MyBool;
int MyInt;
#ifdef _WIN32
#pragma region Methods
#else
#pragma mark Methods
#endif
void MyMethod();
void AnotherMethod();
... and instead do something like this:
CODELABEL( Variables )
bool MyBool;
int MyInt;
CODELABEL( Functions )
void MyMethod();
void AnotherMethod();
Is this possible?
source
share