--- mstools/h/tchar.h 2018/08/09 18:20:30 1.1.1.1 +++ mstools/h/tchar.h 2018/08/09 18:21:09 1.1.1.2 @@ -24,7 +24,11 @@ extern "C" { #ifdef _UNICODE +#ifndef _TCHAR_DEFINED typedef wchar_t TCHAR; +#define _TCHAR_DEFINED +#endif + #define _T(x) L ## x #define _tprintf wprintf @@ -35,6 +39,13 @@ typedef wchar_t TCHAR; #define _vftprintf vfwprintf #define _vstprintf vswprintf #define _vsntprintf _vsnwprintf +#define _tscanf wscanf +#define _ftscanf fwscanf +#define _stscanf swscanf + +#define _tcstod wcstod +#define _tcstol wcstol +#define _tcstoul wcstoul #define _tcscat wcscat #define _tcschr wcschr @@ -49,6 +60,7 @@ typedef wchar_t TCHAR; #define _tcsrchr wcsrchr #define _tcsspn wcsspn #define _tcsstr wcsstr +#define _tcstok wcstok #define _tcsdup _wcsdup #define _tcsicmp _wcsicmp @@ -81,7 +93,11 @@ typedef wchar_t TCHAR; #else +#ifndef _TCHAR_DEFINED typedef char TCHAR; +#define _TCHAR_DEFINED +#endif + #define _T(x) x #define _tprintf printf @@ -96,6 +112,10 @@ typedef char TCHAR; #define _ftscanf fscanf #define _stscanf sscanf +#define _tcstod strtod +#define _tcstol strtol +#define _tcstoul strtoul + #define _tcscat strcat #define _tcschr strchr #define _tcscmp strcmp