From 40bfa923d009c84d04a7f56738c4cebb87eb2763 Mon Sep 17 00:00:00 2001 From: Mihaylov93 Date: Sat, 3 Oct 2020 15:17:20 +0100 Subject: [PATCH] Check if MinGW is defined and implement strsep(). --- simavr/sim/sim_utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/simavr/sim/sim_utils.c b/simavr/sim/sim_utils.c index eeb49867c..53f40fd71 100644 --- a/simavr/sim/sim_utils.c +++ b/simavr/sim/sim_utils.c @@ -27,6 +27,20 @@ #include "sim_utils.h" +#ifdef __MINGW32__ +char *strsep(char **stringp, const char *delim) { + char *rv = *stringp; + if (rv) { + *stringp += strcspn(*stringp, delim); + if (**stringp) + *(*stringp)++ = '\0'; + else + *stringp = 0; + } + return rv; +} +#endif + static argv_p argv_realloc( argv_p argv,