summaryrefslogtreecommitdiffstats
path: root/src/zix_config.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-19 14:04:49 -0400
committerDavid Robillard <d@drobilla.net>2022-08-19 14:21:28 -0400
commit1069c63c6ca2713cce2d6153acc1a1ef9f2b7f8f (patch)
treef6a4710fe2a8e4fe215a53f06c4eef6dc00c588b /src/zix_config.h
parent12cac42e31653323ec607ba3b6512fe9a734d083 (diff)
downloadzix-1069c63c6ca2713cce2d6153acc1a1ef9f2b7f8f.tar.gz
zix-1069c63c6ca2713cce2d6153acc1a1ef9f2b7f8f.tar.bz2
zix-1069c63c6ca2713cce2d6153acc1a1ef9f2b7f8f.zip
Move sem implementation out of header
This avoids having platform conditionals in public headers, which causes build problems for dependants.
Diffstat (limited to 'src/zix_config.h')
-rw-r--r--src/zix_config.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/zix_config.h b/src/zix_config.h
index 7be46e4..f4965f8 100644
--- a/src/zix_config.h
+++ b/src/zix_config.h
@@ -39,6 +39,15 @@
# endif
# endif
+// POSIX.1-2001: clock_gettime()
+# ifndef HAVE_CLOCK_GETTIME
+# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
+# define HAVE_CLOCK_GETTIME 1
+# else
+# define HAVE_CLOCK_GETTIME 0
+# endif
+# endif
+
// POSIX.1-2001: mlock()
# ifndef HAVE_MLOCK
# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
@@ -57,6 +66,15 @@
# endif
# endif
+// POSIX.1-2001: sem_timedwait()
+# ifndef HAVE_SEM_TIMEDWAIT
+# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
+# define HAVE_SEM_TIMEDWAIT 1
+# else
+# define HAVE_SEM_TIMEDWAIT 0
+# endif
+# endif
+
#endif // !defined(ZIX_NO_DEFAULT_CONFIG)
/*
@@ -67,6 +85,12 @@
if the build system defines them all.
*/
+#if HAVE_CLOCK_GETTIME
+# define USE_CLOCK_GETTIME 1
+#else
+# define USE_CLOCK_GETTIME 0
+#endif
+
#if HAVE_MLOCK
# define USE_MLOCK 1
#else
@@ -79,4 +103,10 @@
# define USE_POSIX_MEMALIGN 0
#endif
+#if HAVE_SEM_TIMEDWAIT
+# define USE_SEM_TIMEDWAIT 1
+#else
+# define USE_SEM_TIMEDWAIT 0
+#endif
+
#endif // ZIX_CONFIG_H