I\'m trying to generate include file name in macro. This is supposed to be legal in C++:
#define INCLUDE_FILE \"module_impl_win.hpp\"
#include INCLUDE_FILE
<
You can also use Boost Preprocessor, especially the BOOST_PP_STRINGIZE/BOOST_PP_CAT macros:
#include
#include
#define INCLUDE_FILE(M) BOOST_PP_STRINGIZE(BOOST_PP_CAT(M, _impl_win.hpp))
// expands to: #include "module_impl_win.hpp"
#include INCLUDE_FILE(module)
(cf. C Macro - Dynamic #include)
Note that this suffers from the same problem as @Andrew's answer (leading underscore = reserved identifier).