trying to stringize preprocessor variable that contains "-linux-" seems to replace that sub-string without any warning:
bd.cpp
#include <boost/preprocessor/stringize.hpp>
#ifdef XVAR
#pragma message "XVAR = " BOOST_PP_STRINGIZE(XVAR)
#endif
int main() {
return 0;
}
g++ ./bd.cpp -DXVAR=/usr/lib/x86-test-obj
results in:
In file included from ./bd.cpp:1:0:
./bd.cpp:4:50: note: #pragma message: XVAR = /usr/lib/x86-test-obj
#pragma message "XVAR = " BOOST_PP_STRINGIZE(XVAR)
while
g++ ./bd.cpp -DXVAR=/usr/lib/x86-linux-obj
results in:
In file included from ./bd.cpp:1:0:
./bd.cpp:4:50: note: #pragma message: XVAR = /usr/lib/x86-1-obj
#pragma message "XVAR = " BOOST_PP_STRINGIZE(XVAR)
(note the replacement of "-linux-" by "-1-"). Is there a way how to prevent this from happening ? And for curiosity - does anyone know why is that happening ?
Thanks, Pavel