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

Author: Nicolai Hähnle <[email protected]>
Date:   Wed Nov 15 12:41:58 2017 +0100

threads,configure.ac,meson.build: define and use HAVE_TIMESPEC_GET

Tested with Travis and Appveyor.

v2: add HAVE_TIMESPEC_GET for non-Windows Scons builds
v3: use check_functions in Scons (Eric)

Cc: Rob Herring <[email protected]>
Cc: Alexander von Gluck IV <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103674
Fixes: f1a364878431 ("threads: update for late C11 changes")
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Reviewed-by: Jon Turney <[email protected]> (v2)

---

 configure.ac                | 1 +
 include/c11/threads_posix.h | 2 +-
 meson.build                 | 2 +-
 scons/gallium.py            | 3 +++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 411c4f6b3e..a7ae920ab9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -848,6 +848,7 @@ AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES 
-DHAVE_XLOCALE_H"])
 AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
 AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
 AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
+AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
 
 AC_MSG_CHECKING([whether strtod has locale support])
 AC_LINK_IFELSE([AC_LANG_SOURCE([[
diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
index 2d7ac1326d..45cb6075e6 100644
--- a/include/c11/threads_posix.h
+++ b/include/c11/threads_posix.h
@@ -382,7 +382,7 @@ tss_set(tss_t key, void *val)
 
 /*-------------------- 7.25.7 Time functions --------------------*/
 // 7.25.6.1
-#ifdef __HAIKU__
+#ifndef HAVE_TIMESPEC_GET
 static inline int
 timespec_get(struct timespec *ts, int base)
 {
diff --git a/meson.build b/meson.build
index 1c4200705f..7fdc3c280e 100644
--- a/meson.build
+++ b/meson.build
@@ -578,7 +578,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
   endif
 endforeach
 
-foreach f : ['strtof', 'mkostemp', 'posix_memalign']
+foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get']
   if cc.has_function(f)
     pre_args += '-DHAVE_@0@'.format(f.to_upper())
   endif
diff --git a/scons/gallium.py b/scons/gallium.py
index 94022df180..ef3b2ee81a 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -355,6 +355,9 @@ def generate(env):
         if check_functions(env, ['strtod_l', 'strtof_l']):
             cppdefines += ['HAVE_STRTOD_L']
 
+        if check_functions(env, ['timespec_get']):
+            cppdefines += ['HAVE_TIMESPEC_GET']
+
     if platform == 'windows':
         cppdefines += [
             'WIN32',

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to