From a7bf808cca79a95631e3c82223a0bc8982c94d94 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 25 Oct 2018 11:14:45 +0100 Subject: [PATCH] cmake: Opt-in to modern APIs and thread-safety for Solaris In the Autotools build system, the AC_USE_SYSTEM_EXTENSIONS macro defines __EXTENSIONS__ and _POSIX_PTHREAD_SEMANTICS, and we set the others explicitly when compiling for a Solaris host. Signed-off-by: Simon McVittie --- cmake/config.h.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 15f349097..608de875f 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -13,6 +13,16 @@ * should be placed in this file */ +/* Opt-in to modern APIs and thread-safety for Solaris. In the Autotools + * build system we do the equivalent of this by appending to CFLAGS + * in configure.ac */ +#ifdef __sun +# define __EXTENSIONS__ +# define _POSIX_PTHREAD_SEMANTICS +# define _REENTRANT +# define _XOPEN_SOURCE 500 +#endif + #cmakedefine DBUS_CONSOLE_AUTH_DIR "@DBUS_CONSOLE_AUTH_DIR@" #cmakedefine DBUS_DATADIR "@DBUS_DATADIR@" #cmakedefine DBUS_BINDIR "@DBUS_BINDIR@" -- 2.47.3