sciapp / gr

GR framework: a graphics library for visualisation applications
Other
329 stars 54 forks source link

Fix build with recent mingw-w64 targetting ucrt #172

Closed lazka closed 1 year ago

lazka commented 1 year ago

mingw-w64 targeting ucrt doesn't support _CRT_NON_CONFORMING_WCSTOK and only provides the newer wcstok(), so get rid of _CRT_NON_CONFORMING_WCSTOK and port the code the the thread-safe variant.

This in turn leads to a problem with mingw-w64 targeting old msvcrt, which only has the old wcstok(), so add a macro to make it use the old version there.

Note that this likely dropps support for Visual Studio 2013, since only 2015 has the new wcstok()

(the signature of wcstok() was recently fixed in mingw-w64 master, uncovering this issue, see https://github.com/mingw-w64/mingw-w64/commit/40134887fb81f5be451b5c4c)

lazka commented 1 year ago

On a second though it might be better to ask mingw-w64 first to support _CRT_NON_CONFORMING_WCSTOK, so this all isn't needed.

If an issue comes up, this at least gives some context.