mesa: use strtok_s for strtok_r on windows
authorTapani Pälli <tapani.palli@intel.com>
Wed, 30 Sep 2015 17:38:13 +0000 (20:38 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 1 Oct 2015 05:01:03 +0000 (08:01 +0300)
https://msdn.microsoft.com/en-us/library/ftsafwz3.aspx

v2: use _WIN32 instead of _MSC_VER (Brian Paul)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92183
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/imports.h

index d61279a..9024758 100644 (file)
@@ -423,6 +423,9 @@ _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
 #define snprintf _snprintf
 #endif
 
+#if defined(_WIN32) && !defined(strtok_r)
+#define strtok_r strtok_s
+#endif
 
 #ifdef __cplusplus
 }