By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

How to get _T( ) macro definition for UNICODE?

P: n/a
I have Unicode application which uses _T( ) macro as

#ifdef UNICODE
#define _T(x) L ##x
#define _T(x) x

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?
Nov 19 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
Look at the _T macro that Microsoft uses with TCHAR to switch between ASCII/UNICODE.
Nov 21 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.