Fix block_all_signals compilation in 'strict ANSI' mode
authorIvan Maidanski <ivmai@mail.ru>
Thu, 23 Mar 2017 06:41:37 +0000 (09:41 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 23 Mar 2017 06:50:50 +0000 (09:50 +0300)
* src/atomic_ops.c [(__linux__ || __GLIBC__ || __GNU__)
&& !AO_USE_NO_SIGNALS] (_GNU_SOURCE): Define (before including system
headers).

src/atomic_ops.c

index 5921c9b..a659621 100644 (file)
 # define AO_USE_NO_SIGNALS
 #endif
 
+#if (defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)) \
+    && !defined(AO_USE_NO_SIGNALS) && !defined(_GNU_SOURCE)
+# define _GNU_SOURCE 1
+#endif
+
 #undef AO_REQUIRE_CAS
 #include "atomic_ops.h" /* Without cas emulation! */