Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEarnie Boyd <earnie@users.sf.net>2001-02-02 19:50:06 +0300
committerEarnie Boyd <earnie@users.sf.net>2001-02-02 19:50:06 +0300
commita562294385ebdba63e7fbe175dfdf86118822751 (patch)
treefde4b99e77f5b398e7549d1b479cfff3eed4f7ff /winsup/mingw/include/tchar.h
parent47f810920afff067666bd6496a3c92e92e2d65a8 (diff)
Fri Feb 2 10:34:07 2001 Earnie Boyd <earnie@users.sourceforge.net>
* 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 <eric.paire@ri.silicomp.com>
Diffstat (limited to 'winsup/mingw/include/tchar.h')
-rw-r--r--winsup/mingw/include/tchar.h34
1 files changed, 21 insertions, 13 deletions
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_ */