Using #elif in mingw

I am currently porting some code from Visual Studio to mingw, and apparently the following code works in Visual Studio, but does not work in Mingw

#if defined(BATCH_TRIANGLESTRIP)
static const size_t VERT_COUNT = 4;
#elif defined(BATCH_TRIANGLELIST)
static const size_t VERT_COUNT = 6;
#elif //error here on mingw
#error BATCH_TRIANGLESTRIP or BATCH_TRIANGLELIST need to be defined
#endif

My question is with the latter. #elifI looked at the msdn documentation and apparently they have #elifno condition. I would like to know if the equivalent of the above code in mingw will be

 #if defined(BATCH_TRIANGLESTRIP)
    static const size_t VERT_COUNT = 4; 
    #elif defined(BATCH_TRIANGLELIST)
    static const size_t VERT_COUNT = 6; 
    #else
    #error BATCH_TRIANGLESTRIP or BATCH_TRIANGLELIST need to be defined
    #endif

This is the error I get with the source code.

error: #elif with no expression
0
source share
1 answer

#elifrequires constant expression in accordance with the C ++ standard (and the C standard). Diagnostic error bare #elifis a bug in Visual Studio.

++ #else, #elif. Visual Studio, MinGW - .

+1

All Articles