Signed-off-by: Daniel Lehman dlehman25@gmail.com
--- follow-up to 31c57484ab5927fa61489fb607aeb023e9fb1b1b for winelib --- include/msvcrt/string.h | 16 +++++++++++++++- include/msvcrt/wchar.h | 16 +++++++++++++++- include/tchar.h | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/include/msvcrt/string.h b/include/msvcrt/string.h index f8bc40fb2a..a8bf04d5b4 100644 --- a/include/msvcrt/string.h +++ b/include/msvcrt/string.h @@ -119,8 +119,22 @@ _ACRTIMP wchar_t* __cdecl wcspbrk(const wchar_t*,const wchar_t*); _ACRTIMP wchar_t* __cdecl wcsrchr(const wchar_t*,wchar_t wcFor); _ACRTIMP size_t __cdecl wcsspn(const wchar_t*,const wchar_t*); _ACRTIMP wchar_t* __cdecl wcsstr(const wchar_t*,const wchar_t*); -_ACRTIMP wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*); +_ACRTIMP wchar_t* __cdecl wcstok_s(wchar_t*,const wchar_t*,wchar_t**); _ACRTIMP size_t __cdecl wcsxfrm(wchar_t*,const wchar_t*,size_t); + +#ifdef _UCRT +_ACRTIMP wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*,wchar_t**); +static inline wchar_t* _wcstok(wchar_t* str, const wchar_t *delim) { return wcstok(str, delim, NULL); } +# ifdef __cplusplus +extern "C++" inline wchar_t* wcstok(wchar_t* str, const wchar_t *delim) { return wcstok(str, delim, NULL); } +# elif defined(_CRT_NON_CONFORMING_WCSTOK) +# define wcstok _wcstok +# endif +#else /* _UCRT */ +_ACRTIMP wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*); +# define _wcstok wcstok +#endif /* _UCRT */ + #endif /* _WSTRING_DEFINED */
#ifdef __cplusplus diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h index 0b7be92174..c406e35701 100644 --- a/include/msvcrt/wchar.h +++ b/include/msvcrt/wchar.h @@ -174,8 +174,22 @@ wchar_t* __cdecl wcspbrk(const wchar_t*,const wchar_t*); wchar_t* __cdecl wcsrchr(const wchar_t*,wchar_t wcFor); size_t __cdecl wcsspn(const wchar_t*,const wchar_t*); wchar_t* __cdecl wcsstr(const wchar_t*,const wchar_t*); -wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*); +wchar_t* __cdecl wcstok_s(wchar_t*,const wchar_t*,wchar_t**); size_t __cdecl wcsxfrm(wchar_t*,const wchar_t*,size_t); + +#ifdef _UCRT +wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*,wchar_t**); +static inline wchar_t* _wcstok(wchar_t* str, const wchar_t *delim) { return wcstok(str, delim, NULL); } +# ifdef __cplusplus +extern "C++" inline wchar_t* wcstok(wchar_t* str, const wchar_t *delim) { return wcstok(str, delim, NULL); } +# elif defined(_CRT_NON_CONFORMING_WCSTOK) +# define wcstok _wcstok +# endif +#else /* _UCRT */ +wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*); +# define _wcstok wcstok +#endif /* _UCRT */ + #endif /* _WSTRING_DEFINED */
wchar_t __cdecl btowc(int); diff --git a/include/tchar.h b/include/tchar.h index e14aaf3884..9fc4c72099 100644 --- a/include/tchar.h +++ b/include/tchar.h @@ -148,7 +148,7 @@ extern "C" { #define _tcsspn WINE_tchar_routine(strspn, _mbsspn, wcsspn) #define _tcsstr WINE_tchar_routine(strstr, _mbsstr, wcsstr) #define _tcstod WINE_tchar_routine(strtod, strtod, wcstod) -#define _tcstok WINE_tchar_routine(strtok, _mbstok, wcstok) +#define _tcstok WINE_tchar_routine(strtok, _mbstok, _wcstok) #define _tcstol WINE_tchar_routine(strtol, strtol, wcstol) #define _tcstoul WINE_tchar_routine(strtoul, strtoul, wcstoul) #define _tcsupr WINE_tchar_routine(_strupr, _mbsupr, _wcsupr)