code_junkie

How to use wide string literals in c++ without putting L in front of each one

Nov 12th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #ifdef UNICODE
  2. #define TEXT(s) L ## s
  3. #else
  4. #define TEXT(s) s
  5. #endif
  6.  
  7. #define get_switch( m ) myclass::getSwitch(L##m)
  8.  
  9. get_switch(isrunning)
  10.  
  11. myclass::getswitch(L"isrunning")
  12.  
  13. error: 'L' was not defined in this scope.
  14.  
  15. #define get_switch( m ) myclass::getSwitch(L ## #m)
Add Comment
Please, Sign In to add comment