Closed brechtsanders closed 1 year ago
When using a UCRT build of MinGW-w64 9.0.0 (see my personal builds at https://winlibs.com/) wcstok() seems to be defined differently in string.h and wchar.h.
wcstok()
string.h
wchar.h
string.h defines wcstok() with 2 arguments:
wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
wchar.h defines wcstok() with 3 arguments if _UCRT is defined:
_UCRT
#if defined(_UCRT) wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim,wchar_t **_Ptr) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; #else wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; #endif
This is giving me a lot of trouble with the ACE library when building YARP with UCRT.
Same confusion here also https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strtok-strtok-l-wcstok-wcstok-l-mbstok-mbstok-l
This issue was probably fixes in https://github.com/mingw-w64/mingw-w64/commit/40134887fb81f5be451b5c4c92dc1e0372f08b68 commit.
When using a UCRT build of MinGW-w64 9.0.0 (see my personal builds at https://winlibs.com/)
wcstok()
seems to be defined differently instring.h
andwchar.h
.string.h
defineswcstok()
with 2 arguments:wchar.h
defineswcstok()
with 3 arguments if_UCRT
is defined:This is giving me a lot of trouble with the ACE library when building YARP with UCRT.