* 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
#define _WConst_return _CONST_RETURN
-#ifdef _UNICODE
-
#ifdef __cplusplus
}
#endif
+
+#ifdef _UNICODE
+/** UNICODE ******************************************************************/
+
#include <wchar.h>
#ifdef __cplusplus
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
#define _tseekdir _wseekdir
#else
-
-#ifdef __cplusplus
-}
-#endif
+/** ANSI *********************************************************************/
#include <string.h>
#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
#define _tsetlocale setlocale
#ifdef _MBCS
+/** MBCS *********************************************************************/
#ifdef __cplusplus
}
#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
#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);
#define _istlead _ismbblead
#define _istleadbyte isleadbyte
#define _istleadbyte_l _isleadbyte_l
-#else
+
+#else /* !_MBCS */
+/** SBCS *********************************************************************/
#ifndef __TCHAR_DEFINED
#define __TCHAR_DEFINED
#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)