Mesa (master): move windows strtok_r define to u_string

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 21 20:52:39 UTC 2020


Module: Mesa
Branch: master
Commit: 369f00259113d5c157b88d52bd002d292c21fedf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=369f00259113d5c157b88d52bd002d292c21fedf

Author: Dylan Baker <dylan at pnwbakers.com>
Date:   Mon Sep 10 10:26:26 2018 -0700

move windows strtok_r define to u_string

This makes more sense for it, it's only used in the glsl compiler
currently, so we could probably move it there, but this seems fine for a
header only #define.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>

---

 src/util/imports.h  | 4 ----
 src/util/u_string.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util/imports.h b/src/util/imports.h
index 149bb225ad4..9556223b3ba 100644
--- a/src/util/imports.h
+++ b/src/util/imports.h
@@ -119,10 +119,6 @@ extern int
 _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
 
 
-#if defined(_WIN32) && !defined(HAVE_STRTOK_R)
-#define strtok_r strtok_s
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/util/u_string.h b/src/util/u_string.h
index cd21f9d1af1..88df2cceda6 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -116,6 +116,10 @@ util_asprintf(char **str, const char *fmt, ...)
 
 #define strdup _strdup
 
+#if defined(_WIN32) && !defined(HAVE_STRTOK_R)
+#define strtok_r strtok_s
+#endif
+
 #endif
 
 



More information about the mesa-commit mailing list