Mesa (master): mesa/imports: let the build system detect strtok_r()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 5 22:39:04 UTC 2019


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

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Tue Nov  5 00:13:27 2019 +0000

mesa/imports: let the build system detect strtok_r()

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2013
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea at yahoo.com>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

---

 meson.build             | 2 +-
 scons/gallium.py        | 3 +++
 src/mesa/main/imports.h | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 457cc0c5fdc..b9a6da01d31 100644
--- a/meson.build
+++ b/meson.build
@@ -1149,7 +1149,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'
   endif
 endforeach
 
-foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r', 'flock']
+foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r', 'flock', 'strtok_r']
   if cc.has_function(f)
     pre_args += '-DHAVE_ at 0@'.format(f.to_upper())
   endif
diff --git a/scons/gallium.py b/scons/gallium.py
index b216304170f..c0f6f6c91ca 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -381,6 +381,9 @@ def generate(env):
         if check_header(env, 'sys/shm.h'):
             cppdefines += ['HAVE_SYS_SHM_H']
 
+        if check_functions(env, ['strtok_r']):
+            cppdefines += ['HAVE_STRTOK_R']
+
         #FIXME: we should really be checking for the major()/minor()
         # functions/macros in these headers, but check_functions()'s
         # SConf.CheckFunc() doesn't seem to support macros.
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 7f10ecec810..7cf5f247be4 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -309,7 +309,7 @@ extern int
 _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
 
 
-#if defined(_WIN32) && !defined(strtok_r)
+#if defined(_WIN32) && !defined(HAVE_STRTOK_R)
 #define strtok_r strtok_s
 #endif
 




More information about the mesa-commit mailing list