summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2005-10-13 20:31:50 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2005-10-13 20:31:50 +0000
commit5d023ae8d5e72dcd007b021eacb65508a07cf03f (patch)
tree61e919ce52c4113d7faeb299eb0371023600b1c7
parent0e7712aeeb4d80fbed2aeaf7cd1c5f2d700163e7 (diff)
downloadcygnal-5d023ae8d5e72dcd007b021eacb65508a07cf03f.tar.gz
cygnal-5d023ae8d5e72dcd007b021eacb65508a07cf03f.tar.bz2
cygnal-5d023ae8d5e72dcd007b021eacb65508a07cf03f.zip
2005-10-13 Wu Yongwei <adah@users.sourceforge.net>
* include/tchar.h: Include <wchar.h> when _UNICODE is defined. (_TEOF): New macro definition for _UNICODE and non_UNICODE cases.
-rw-r--r--winsup/mingw/ChangeLog5
-rw-r--r--winsup/mingw/include/tchar.h15
2 files changed, 20 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index 76ee8eef0..c81467246 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-13 Wu Yongwei <adah@users.sourceforge.net>
+
+ * include/tchar.h: Include <wchar.h> when _UNICODE is defined.
+ (_TEOF): New macro definition for _UNICODE and non_UNICODE cases.
+
2005-10-12 Danny Smith <dannysmith@users.sourceforge.net>
* include/stddef.h: Remove.
diff --git a/winsup/mingw/include/tchar.h b/winsup/mingw/include/tchar.h
index 241325acd..a07d75f45 100644
--- a/winsup/mingw/include/tchar.h
+++ b/winsup/mingw/include/tchar.h
@@ -31,6 +31,10 @@
*/
#ifdef _UNICODE
+/*
+ * Include <wchar.h> for wchar_t and WEOF if _UNICODE.
+ */
+#include <wchar.h>
/*
* Use TCHAR instead of char or wchar_t. It will be appropriately translated
@@ -44,6 +48,11 @@ typedef wchar_t _TCHAR;
#define _TCHAR_DEFINED
#endif
+/*
+ * Use _TEOF instead of EOF or WEOF. It will be appropriately translated if
+ * _UNICODE is correctly defined (or not).
+ */
+#define _TEOF WEOF
/*
* __TEXT is a private macro whose specific use is to force the expansion of a
@@ -212,6 +221,7 @@ typedef wchar_t _TCHAR;
#define _trewinddir _wrewinddir
#define _ttelldir _wtelldir
#define _tseekdir _wseekdir
+
#else /* Not _UNICODE */
/*
@@ -226,6 +236,11 @@ typedef char _TCHAR;
#endif
/*
+ * _TEOF, the constant you should use instead of EOF.
+ */
+#define _TEOF EOF
+
+/*
* __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