Skip to content

Instantly share code, notes, and snippets.

Last active June 7, 2016 17:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
spaces in macro and boost::icl
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
- 1 & 2 compile
- 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`
Copy link

Does this happen with cl.exe -E, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment