#define PATH "yagh/headers/" #define FILNAME "includefile" #define CONCAT(a__, b__) CONCAT_DO(a__, b__) #define CONCAT_DO(a__, b__) a__##b__ #define CONCATTHREE(a__, b__, c__) CONCAT(CONCAT(a__, b__), c__) #define STRINGIFY(a__) #a__ #include STRINGIFY(CONCATTHREE(PATH ,FILNAME ,.h));
This macro works fine in the VS compiler, but does not compile in the GCC compiler:
Error: error: inserting "/" and "includefile" does not give a valid preprocessing token
and for some included files it gives an error:
Error: insert "includefile" and "." does not give a valid pre-processing token
c gcc c-preprocessor string-concatenation stringification
SoccerKid
source share