Building SDL_mixer from Hg with mingw fails

Is anyone able to build SDL_mixer from Hg on mingw? I get:

music.c:1593: undefined reference to `_strtok_s’

music.c:1593: undefined reference to `_strtok_s’

MingW follows the _WIN32 path…

#ifdef _WIN32
for (path = strtok_s(paths, “;”, &context); path; path = strtok_s(NULL,
";", &context)) {
#else
for (path = strtok_r(paths, “:;”, &context); path; path =
strtok_r(NULL, “:;”, &context)) {
#endif

…is there a strtok_s equivalent for MingW, or does it have strtok_r?

–ryan.

It lacks both. I don’t think there’s an equivalent.

For now I’ve removed all the code from the soundfont functions and
simply return 0, since I don’t (yet) use the FluidSynth support.On 06/13/2011 08:53 AM, Ryan C. Gordon wrote:

music.c:1593: undefined reference to `_strtok_s’

MingW follows the _WIN32 path…

#ifdef _WIN32
for (path = strtok_s(paths, “;”, &context); path; path = strtok_s(NULL,
";", &context)) {
#else
for (path = strtok_r(paths, “:;”, &context); path; path = strtok_r(NULL,
":;", &context)) {
#endif

…is there a strtok_s equivalent for MingW, or does it have strtok_r?

#ifdef _WIN32
for (path = strtok_s(paths, “;”, &context); path; path = strtok_s(NULL,
";", &context)) {
#else
for (path = strtok_r(paths, “:;”, &context); path; path = strtok_r(NULL,
":;", &context)) {
#endif

…is there a strtok_s equivalent for MingW, or does it have strtok_r?

It lacks both. I don’t think there’s an equivalent.

For now I’ve removed all the code from the soundfont functions and simply
return 0, since I don’t (yet) use the FluidSynth support.

mingw uses MSVC runtime and as far as I know all the ANSI C calls in MSVC
runtime are thread safe, this is why there is no strtok_r, localtime_r …

MSVC reaches this goal using thread local storage for the static datas.–
Bye,
Gabry