* 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 _tcscat wcscat
#define _tcschr wcschr
#define _tcscpy wcscpy
+#define _tcscpy_s wcscpy_s
#define _tcscspn wcscspn
#define _tcslen wcslen
#define _tcsnlen wcsnlen
#define _tcsftime wcsftime
#define _tcsftime_l _wcsftime_l
+#define _tasctime_s _wasctime_s
+#define _tctime_s _wctime_s
+#define _tctime32_s _wctime32_s
+#define _tctime64_s _wctime64_s
+#define _tstrdate_s _wstrdate_s
+#define _tstrtime_s _wstrtime_s
+
#define _tchdir _wchdir
#define _tgetcwd _wgetcwd
#define _tgetdcwd _wgetdcwd
#define _tputenv _wputenv
#define _tsearchenv _wsearchenv
#define _tsplitpath _wsplitpath
+#define _tsplitpath_s _wsplitpath_s
#define _tfdopen _wfdopen
#define _tfsopen _wfsopen
#define _tseekdir _wseekdir
#else
-
-#ifdef __cplusplus
-}
-#endif
+/** ANSI *********************************************************************/
#include <string.h>
#define _tcscat strcat
#define _tcscpy strcpy
+#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 _tcsftime strftime
#define _tcsftime_l _strftime_l
+#define _tasctime_s asctime_s
+#define _tctime_s ctime_s
+#define _tctime32_s _ctime32_s
+#define _tctime64_s _ctime64_s
+#define _tstrdate_s _strdate_s
+#define _tstrtime_s _strtime_s
+
#define _tchdir _chdir
#define _tgetcwd _getcwd
#define _tgetdcwd _getdcwd
#define _tputenv _putenv
#define _tsearchenv _searchenv
#define _tsplitpath _splitpath
+#define _tsplitpath_s _splitpath_s
#ifdef _POSIX_
#define _tfdopen fdopen
#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)