From 5b204b093851f6be0a16d4b96ed7b8c995b92568 Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Wed, 14 Feb 2018 10:58:08 -0700 Subject: [PATCH] fix strtok_r test on MSW --- tests/test_string.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_string.c b/tests/test_string.c index a28d001..08989cb 100644 --- a/tests/test_string.c +++ b/tests/test_string.c @@ -20,6 +20,16 @@ #include "test.h" /* ARRAY_SIZE */ +/* strtok_s() has appeared in visual studio 2005. + Use own implementation for older versions. */ +#ifdef _MSC_VER +# if (_MSC_VER >= 1400) +# define strtok_r strtok_s +# else +# define strtok_r xmpp_strtok_r +# endif +#endif /* _MSC_VER */ + static int test_strtok_r(void) { const char *test = "-abc-=-def--";