diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index e8b5ff6d4..c99156319 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,4 +1,13 @@ +Fri Feb 2 10:34:07 2001 Earnie Boyd + + * include/tchar.h: (__TEXT): Add private macro. + (_TEXT): Modify definition to use __TEXT. + (_T): Ditto. + This change allows the passing of a MACRO as an argument and have that + MACRO resolved first. + Thanks to: Eric PAIRE + Wed Jan 31 17:12:51 2001 Earnie Boyd * Makefile.in: Increment version to 0.5 diff --git a/winsup/mingw/include/tchar.h b/winsup/mingw/include/tchar.h index c2eb90527..5ec224ebb 100644 --- a/winsup/mingw/include/tchar.h +++ b/winsup/mingw/include/tchar.h @@ -61,14 +61,13 @@ typedef wchar_t TCHAR; /* - * Enclose constant strings and literal characters in the _TEXT macro to make - * them unicode constant strings when _UNICODE is defined. + * __TEXT is a private macro whose specific use is to force the expansion of a + * macro passed as an argument to the macros _T or _TEXT. DO NOT use this + * macro within your programs. It's name and function could change without + * notice. */ -#define _TEXT(x) L ## x - -#ifndef _T -#define _T(x) L ## x -#endif +#undef __TEXT +#define __TEXT(x) L ## x /* for porting from other Windows compilers */ #if 0 // no wide startup module @@ -213,13 +212,13 @@ typedef char TCHAR; #endif /* - * Enclose constant strings and characters in the _TEXT macro. + * __TEXT is a private macro whose specific use is to force the expansion of a + * macro passed as an argument to the macros _T or _TEXT. DO NOT use this + * macro within your programs. It's name and function could change without + * notice. */ -#define _TEXT(x) x - -#ifndef _T -#define _T(x) x -#endif +#undef __TEXT +#define __TEXT(x) x /* for porting from other Windows compilers */ #define _tmain main @@ -351,5 +350,14 @@ typedef char TCHAR; #endif /* Not _UNICODE */ +/* + * UNICODE a constant string when _UNICODE is defined else returns the string + * unmodified. Also defined in w32api/winnt.h. + */ +#undef _TEXT +#define _TEXT(x) __TEXT(x) +#undef _T +#define _T(x) __TEXT(x) + #endif /* Not _TCHAR_H_ */