GCC C++: Defining unicode string const in macro
Posted on 2014-03-09
This macro is intended to define a string as both ASICII and unicode.
#define DEFINE_XML_TOKEN_STRING(n, s) const char n##a = #s; const wchar_t n##w = L#s;
Show result in this code:
const char CONFIG_ELMa = "config"; const wchar CONFIG_ELMw = L"config";
Works with fine Visual Studio. The preprocessor in GCC seems to have a problem reporting error:
error: 'L' was not declared in this scope
note: in expansion of macro 'DEFINE_XML_TOKEN_STRING'