diff --git a/src/porting.h b/src/porting.h index 4963916f0..7c652663a 100644 --- a/src/porting.h +++ b/src/porting.h @@ -55,11 +55,6 @@ #define strncasecmp(x, y, n) strnicmp(x, y, n) #endif -#ifdef __MINGW32__ - // was broken in 2013, unclear if still needed - #define strtok_r(x, y, z) mystrtok_r(x, y, z) -#endif - #if !HAVE_STRLCPY #define strlcpy(d, s, n) mystrlcpy(d, s, n) #endif diff --git a/src/util/string.cpp b/src/util/string.cpp index e06990356..03f9d5cf1 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -292,32 +292,6 @@ size_t mystrlcpy(char *dst, const char *src, size_t size) noexcept return srclen; } -char *mystrtok_r(char *s, const char *sep, char **lasts) noexcept -{ - char *t; - - if (!s) - s = *lasts; - - while (*s && strchr(sep, *s)) - s++; - - if (!*s) - return nullptr; - - t = s; - while (*t) { - if (strchr(sep, *t)) { - *t++ = '\0'; - break; - } - t++; - } - - *lasts = t; - return s; -} - u64 read_seed(const char *str) { char *endptr = nullptr; diff --git a/src/util/string.h b/src/util/string.h index d57a7baa9..eaa13a264 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -84,7 +84,6 @@ u32 readFlagString(std::string str, const FlagDesc *flagdesc, u32 *flagmask); std::string writeFlagString(u32 flags, const FlagDesc *flagdesc, u32 flagmask); size_t mystrlcpy(char *dst, const char *src, size_t size) noexcept; -char *mystrtok_r(char *s, const char *sep, char **lasts) noexcept; /// @brief turn string into a map seed. either directly if it's a number or by hashing it. u64 read_seed(const char *str);