update for HEAD-2003091401
[reactos.git] / include / tchar.h
index 9dc3ab4..f34d7ef 100644 (file)
@@ -26,7 +26,7 @@
  *
  *  This code is distributed in the hope that it will be useful but
  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- *  DISCLAMED. This includes but is not limited to warranties of
+ *  DISCLAIMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
  * $Revision$
@@ -38,6 +38,8 @@
 #ifndef        _TCHAR_H_
 #define _TCHAR_H_
 
+#include <msvcrt/string.h>
+
 /*
  * NOTE: This tests _UNICODE, which is different from the UNICODE define
  *       used to differentiate Win32 API calls.
  */
 #ifndef _TCHAR_DEFINED
 #ifndef RC_INVOKED
-typedef        wchar_t TCHAR;
+typedef wchar_t _TCHAR;
+typedef wchar_t _TSCHAR;
+typedef wchar_t _TUCHAR;
+typedef wchar_t _TXCHAR;
+/* #if !__STDC__ */
+typedef wchar_t TCHAR;
+/* #endif */
 #endif /* Not RC_INVOKED */
 #define _TCHAR_DEFINED
 #endif
@@ -61,13 +69,19 @@ typedef     wchar_t TCHAR;
  * Enclose constant strings and literal characters in the _TEXT and _T macro to make
  * them unicode constant strings when _UNICODE is defined.
  */
+#ifndef _TEXT
 #define        _TEXT(x)        L ## x
+#endif
+#ifndef _T
 #define        _T(x)           L ## x
+#endif
 
 /*
  * Unicode functions
  */
 
+#define _tmain _wmain
+
 #define        _tprintf                wprintf
 #define        _ftprintf               fwprintf
 #define        _stprintf               swprintf
@@ -102,6 +116,7 @@ typedef     wchar_t TCHAR;
 #define        _tcsncat                wcsncat
 #define        _tcsncmp        wcsncmp
 #define        _tcsncpy        wcsncpy
+#define _tcsnlen        wcsnlen
 #define        _tcspbrk                wcspbrk
 #define        _tcsrchr                wcsrchr
 #define        _tcsspn         wcsspn
@@ -142,7 +157,15 @@ typedef    wchar_t TCHAR;
  */
 #ifndef _TCHAR_DEFINED
 #ifndef RC_INVOKED
-typedef char   TCHAR;
+typedef char _TCHAR;
+typedef signed char _TSCHAR;
+typedef unsigned char _TUCHAR;
+typedef char _TXCHAR;
+
+/*#if !__STDC__*/
+typedef char TCHAR;
+/*#endif*/
+
 #endif
 #define _TCHAR_DEFINED
 #endif
@@ -150,14 +173,20 @@ typedef char      TCHAR;
 /*
  * Enclose constant strings and characters in the _TEXT and _T macro.
  */
+#ifndef _TEXT
 #define        _TEXT(x)        x
+#endif
+#ifndef _T
 #define        _T(x)           x
+#endif
 
 
 /*
  * Non-unicode (standard) functions
  */
 
+#define _tmain main
+
 #define        _tprintf        printf
 #define _ftprintf      fprintf
 #define        _stprintf       sprintf
@@ -192,6 +221,7 @@ typedef char        TCHAR;
 #define        _tcsncat        strncat
 #define        _tcsncmp        strncmp
 #define        _tcsncpy        strncpy
+#define _tcsnlen        strnlen
 #define        _tcspbrk        strpbrk
 #define        _tcsrchr        strrchr
 #define _tcsspn                strspn