[tchar.h]
[reactos.git] / reactos / include / crt / tchar.h
index 08c6c1c..d7c3147 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_TCHAR
 #define _INC_TCHAR
@@ -79,12 +79,14 @@ extern "C" {
 
 #define _WConst_return _CONST_RETURN
 
-#ifdef _UNICODE
-
 #ifdef __cplusplus
 }
 #endif
 
+
+#ifdef _UNICODE
+/** UNICODE ******************************************************************/
+
 #include <wchar.h>
 
 #ifdef __cplusplus
@@ -106,10 +108,11 @@ extern "C" {
   typedef wint_t _TINT;
 #endif
 
+#ifndef NO_OLDNAMES
 #ifndef _TCHAR_DEFINED
 #define _TCHAR_DEFINED
-#ifndef        NO_OLDNAMES
-  typedef wchar_t TCHAR;
+  typedef wchar_t TCHAR,*PTCHAR;
+  typedef wchar_t TBYTE,*PTBYTE;
 #endif
 #endif
 
@@ -479,10 +482,7 @@ extern "C" {
 #define _tseekdir      _wseekdir
 
 #else
-
-#ifdef __cplusplus
-}
-#endif
+/** ANSI *********************************************************************/
 
 #include <string.h>
 
@@ -624,9 +624,7 @@ extern "C" {
 #define _tcscpy_s strcpy_s
 #define _tcsdup _strdup
 #define _tcslen strlen
-#if 0
 #define _tcsnlen strnlen
-#endif
 #define _tcsxfrm strxfrm
 #define _tcsxfrm_l _strxfrm_l
 #define _tcserror strerror
@@ -753,6 +751,7 @@ extern "C" {
 #define _tsetlocale setlocale
 
 #ifdef _MBCS
+/** MBCS *********************************************************************/
 
 #ifdef __cplusplus
 }
@@ -773,11 +772,12 @@ extern "C" {
 #define __TCHAR_DEFINED
 #endif
 
+#ifndef NO_OLDNAMES
 #ifndef _TCHAR_DEFINED
-#ifndef        NO_OLDNAMES
-  typedef char TCHAR;
-#endif
 #define _TCHAR_DEFINED
+  typedef char TCHAR,*PTCHAR;
+  typedef unsigned char TBYTE,*PTBYTE;
+#endif
 #endif
 
 #ifdef _MB_MAP_DIRECT
@@ -851,7 +851,9 @@ extern "C" {
 #define _tclen _mbclen
 #define _tccpy _mbccpy
 #define _tccpy_l _mbccpy_l
-#else
+
+
+#else /* !_MB_MAP_DIRECT */
 
   _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
   _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
@@ -957,7 +959,9 @@ extern "C" {
 #define _istlead _ismbblead
 #define _istleadbyte isleadbyte
 #define _istleadbyte_l _isleadbyte_l
-#else
+
+#else /* !_MBCS */
+/** SBCS *********************************************************************/
 
 #ifndef __TCHAR_DEFINED
 #define __TCHAR_DEFINED
@@ -1106,8 +1110,10 @@ extern "C" {
 #define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters))
 #define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count))
 #define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value))
-#endif
-#endif
+
+#endif /* !_MBCS */
+#endif  /* !UNICODE */
+/*****************************************************************************/
 
 #define _T(x) __T(x)
 #define _TEXT(x) __T(x)