Possible duplicate:How to convert concatenated strings to widescreen char with C preprocessor?
I have a string literal defined with #define:
#define B "1234\0"
How to use this definition to get this wide literal at compile time ?:
L"1234\0"
(only the string literal #define d with L added to turn it into a wide string).
#define
L
I tried this:
#define MAKEWIDE(s) L##s
but it generates LB
LB
Marker insertion requires an additional level of indirection for the proper processing of macros used as operands. Try something like:
#define PASTE(x, y) x##y #define MAKEWIDE(x) PASTE(L,x)
This will work just fine:
#define B "1234\0" #define LB L"" B