How to get _T( ) macro definition for UNICODE?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nagasai sowmya

    How to get _T( ) macro definition for UNICODE?

    I have Unicode application which uses _T( ) macro as

    [code]
    #ifdef UNICODE
    #define _T(x) L ##x
    #else
    #define _T(x) x
    [/icode]

    GCC compiler maps L to wchar_t which is 4 bytes on UNIX platforms. Now I need to have L defined in such a way that it takes 2 bytes. For this I used -fshort-wchar gcc flag, but this option is not available on some flavour of AIX machine on which I need to port my application.

    Please can anyone suggest a way to define _T(x) or any other way such that in UNICODE, _T(x) gets always defined to 2byte wide character string even without using -fshort-wchar gcc option?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Look at the _T macro that Microsoft uses with TCHAR to switch between ASCII/UNICODE.

    Comment

    Working...