Changeset

9150:c1d5f52274cf

net, pposix, signal: Check for redefined defines, fix warnings.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 08 Aug 2018 09:27:34 +0200
parents 9149:d03f21729b2c
children 9151:fee3933ff346
files util-src/net.c util-src/pposix.c util-src/signal.c
diffstat 3 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util-src/net.c	Wed Aug 08 08:19:01 2018 +0100
+++ b/util-src/net.c	Wed Aug 08 09:27:34 2018 +0200
@@ -9,7 +9,10 @@
 --
 */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
+
 #include <stddef.h>
 #include <string.h>
 #include <errno.h>
--- a/util-src/pposix.c	Wed Aug 08 08:19:01 2018 +0100
+++ b/util-src/pposix.c	Wed Aug 08 09:27:34 2018 +0200
@@ -17,11 +17,17 @@
 
 
 #if defined(__linux__)
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #else
+#ifndef _DEFAULT_SOURCE
 #define _DEFAULT_SOURCE
 #endif
+#endif
+#ifndef _POSIX_C_SOURCE
 #define _POSIX_C_SOURCE 200809L
+#endif
 
 #include <stdlib.h>
 #include <math.h>
--- a/util-src/signal.c	Wed Aug 08 08:19:01 2018 +0100
+++ b/util-src/signal.c	Wed Aug 08 09:27:34 2018 +0200
@@ -26,7 +26,9 @@
  * OTHER DEALINGS IN THE SOFTWARE.
 */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include <signal.h>
 #include <stdlib.h>