Last active
June 7, 2016 17:17
-
-
Save nil-ableton/6bb031802e2c2447af0f81bce86a6dea to your computer and use it in GitHub Desktop.
spaces in macro and boost::icl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Encountered while building with FASTbuild cache on a library using boost::icl | |
See element_iterator.hpp and ICL_INTERVAL_TYPE. | |
FASTbuild uses cl.exe -P to produce a pre-processed file. That file gets a const stitched onto it. | |
Steps to reproduce: | |
1- compile with cl.exe clmacro.cpp | |
2- compile with cl.exe -P -Ficlmacro.i.cpp clmacro.cpp && cl.exe clmacro.i.cpp | |
Expected: | |
- 1 & 2 compile | |
Observed: | |
- only 1 compiles | |
*/ | |
#define funny_type(__x) __x | |
// this fixes it in MSVC: | |
#define funny_type_guard | |
#define funny_type2(__x) __x funny_type_guard | |
int main(void) | |
{ | |
funny_type(int)const a = 2; // cl.exe -P clmacro.cpp -> `intconst a` | |
funny_type2(int)const b = 4; // cl.exe -P clmacro.cpp -> `int const b` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this happen with
cl.exe -E
, too?