From 67975a5944706e382fe1e7b00d226715c6242358 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 20 May 2024 10:07:16 -0400 Subject: Mass attempt at windows portability --- src/str.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/str.c') diff --git a/src/str.c b/src/str.c index a5d42a6..45b32df 100644 --- a/src/str.c +++ b/src/str.c @@ -2,7 +2,18 @@ * @file strings.c */ #include -#include "str.h" +#include "omc.h" + +#if defined(OMC_OS_WINDOWS) +char *strsep(char **str, const char *delim) { + static char *last; + return strtok_r(*str, delim, &last); +} + +char *strndup(const char *str, size_t nelem) { + return calloc(nelem, sizeof(*str)); +} +#endif int num_chars(const char *sptr, int ch) { int result = 0; -- cgit