summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-09-26 14:49:39 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-09-27 09:26:26 +0200
commit51bb05f15b78fbfdf53417ec1d1c21e999c0e556 (patch)
treee01e39f12c28120defd9f0b363201ce9163a103a
parenta0ea1751683d7fb242b9a8076b05058f21dfe052 (diff)
downloadouroboros-51bb05f15b78fbfdf53417ec1d1c21e999c0e556.zip
ouroboros-51bb05f15b78fbfdf53417ec1d1c21e999c0e556.tar.gz
include: Remove _DEFAULT_SOURCE in endian.h
This removes the _DEFAULT_SOURCE definition in the endian header as it should not be there. This avoids double and conflicting definitions. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
-rw-r--r--include/ouroboros/endian.h5
-rw-r--r--src/ipcpd/eth/eth.c2
-rw-r--r--src/ipcpd/ipcp.c4
-rw-r--r--src/ipcpd/local/main.c4
-rw-r--r--src/ipcpd/normal/connmgr.c4
-rw-r--r--src/ipcpd/normal/dht.c4
-rw-r--r--src/ipcpd/normal/dir.c4
-rw-r--r--src/ipcpd/normal/dt.c4
-rw-r--r--src/ipcpd/normal/enroll.c4
-rw-r--r--src/ipcpd/normal/fa.c4
-rw-r--r--src/ipcpd/normal/main.c4
-rw-r--r--src/ipcpd/normal/pol/flat.c4
-rw-r--r--src/ipcpd/normal/pol/graph.c4
-rw-r--r--src/ipcpd/normal/pol/link_state.c4
-rw-r--r--src/ipcpd/normal/sdu_sched.c4
-rw-r--r--src/ipcpd/shim-data.c4
-rw-r--r--src/ipcpd/udp/main.c4
-rw-r--r--src/irmd/main.c7
-rw-r--r--src/irmd/proc_table.c4
-rw-r--r--src/irmd/registry.c4
-rw-r--r--src/lib/dev.c7
-rw-r--r--src/lib/hash.c4
-rw-r--r--src/lib/hashtable.c4
-rw-r--r--src/lib/irm.c4
-rw-r--r--src/lib/md5.c4
-rw-r--r--src/lib/sha3.c4
26 files changed, 105 insertions, 4 deletions
diff --git a/include/ouroboros/endian.h b/include/ouroboros/endian.h
index f29b674..04c2246 100644
--- a/include/ouroboros/endian.h
+++ b/include/ouroboros/endian.h
@@ -23,9 +23,12 @@
#ifndef OUROBOROS_ENDIAN_H
#define OUROBOROS_ENDIAN_H
+
#if defined(__linux__) || defined(__CYGWIN__) || \
(defined(__MACH__) && !defined(__APPLE__))
-#define _DEFAULT_SOURCE
+#ifndef _DEFAULT_SOURCE
+#error You must define _DEFAULT_SOURCE before including this file
+#endif
#include <endian.h>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/endian.h>
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index 443f3fd..114cafc 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -29,6 +29,8 @@
#define _DARWIN_C_SOURCE
#elif defined(__FreeBSD__)
#define __BSD_VISIBLE 1
+#elif defined (__linux__) || defined (__CYGWIN__)
+#define _DEFAULT_SOURCE
#else
#define _POSIX_C_SOURCE 200112L
#endif
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 0b5ddf1..5ea5453 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -25,8 +25,12 @@
#define NPROC (sysconf(_SC_NPROCESSORS_ONLN))
#endif
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
#define __XSI_VISIBLE 500
+#endif
#include "config.h"
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index 358f638..c83f85f 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c
index bf07ebc..7b71761 100644
--- a/src/ipcpd/normal/connmgr.c
+++ b/src/ipcpd/normal/connmgr.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#define OUROBOROS_PREFIX "connection-manager"
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c
index a6f1928..a2fa486 100644
--- a/src/ipcpd/normal/dht.c
+++ b/src/ipcpd/normal/dht.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/normal/dir.c b/src/ipcpd/normal/dir.c
index 345d220..a195f01 100644
--- a/src/ipcpd/normal/dir.c
+++ b/src/ipcpd/normal/dir.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#define OUROBOROS_PREFIX "directory"
diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c
index b9d8934..c041400 100644
--- a/src/ipcpd/normal/dt.c
+++ b/src/ipcpd/normal/dt.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c
index a321db2..78305ff 100644
--- a/src/ipcpd/normal/enroll.c
+++ b/src/ipcpd/normal/enroll.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 199309L
+#endif
#define OUROBOROS_PREFIX "enrollment"
diff --git a/src/ipcpd/normal/fa.c b/src/ipcpd/normal/fa.c
index 067a6e7..8716713 100644
--- a/src/ipcpd/normal/fa.c
+++ b/src/ipcpd/normal/fa.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index b131bbb..3f05f42 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200809L
+#endif
#include "config.h"
diff --git a/src/ipcpd/normal/pol/flat.c b/src/ipcpd/normal/pol/flat.c
index cab7415..89b7fff 100644
--- a/src/ipcpd/normal/pol/flat.c
+++ b/src/ipcpd/normal/pol/flat.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#define OUROBOROS_PREFIX "flat-addr-auth"
diff --git a/src/ipcpd/normal/pol/graph.c b/src/ipcpd/normal/pol/graph.c
index 544f040..ec0917c 100644
--- a/src/ipcpd/normal/pol/graph.c
+++ b/src/ipcpd/normal/pol/graph.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#define OUROBOROS_PREFIX "graph"
diff --git a/src/ipcpd/normal/pol/link_state.c b/src/ipcpd/normal/pol/link_state.c
index 59bae61..e2e9eab 100644
--- a/src/ipcpd/normal/pol/link_state.c
+++ b/src/ipcpd/normal/pol/link_state.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/normal/sdu_sched.c b/src/ipcpd/normal/sdu_sched.c
index 6ce18ed..e6d705f 100644
--- a/src/ipcpd/normal/sdu_sched.c
+++ b/src/ipcpd/normal/sdu_sched.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/shim-data.c b/src/ipcpd/shim-data.c
index 27b9817..6c28c79 100644
--- a/src/ipcpd/shim-data.c
+++ b/src/ipcpd/shim-data.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/ipcpd/udp/main.c b/src/ipcpd/udp/main.c
index 2e59e1a..3a66180 100644
--- a/src/ipcpd/udp/main.c
+++ b/src/ipcpd/udp/main.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/irmd/main.c b/src/irmd/main.c
index aeb43f0..4c6908b 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -20,8 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
-#define _POSIX_C_SOURCE 200812L
-#define __XSI_VISIBLE 500
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
+#define _POSIX_C_SOURCE 200809L
+#endif
#include "config.h"
diff --git a/src/irmd/proc_table.c b/src/irmd/proc_table.c
index e8d0844..115eb2d 100644
--- a/src/irmd/proc_table.c
+++ b/src/irmd/proc_table.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
+#endif
#include "config.h"
diff --git a/src/irmd/registry.c b/src/irmd/registry.c
index 145a745..6c86da2 100644
--- a/src/irmd/registry.c
+++ b/src/irmd/registry.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200809L
+#endif
#include "config.h"
diff --git a/src/lib/dev.c b/src/lib/dev.c
index dd908f7..1d1e947 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -20,9 +20,14 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
+#define _POSIX_C_SOURCE 200809L
+#endif
+
#include <ouroboros/endian.h>
-#define _POSIX_C_SOURCE 200809L
#include "config.h"
#include <ouroboros/hash.h>
diff --git a/src/lib/hash.c b/src/lib/hash.c
index 9b74967..10e10c1 100644
--- a/src/lib/hash.c
+++ b/src/lib/hash.c
@@ -23,6 +23,10 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#endif
+
#include "config.h"
#include <ouroboros/hash.h>
diff --git a/src/lib/hashtable.c b/src/lib/hashtable.c
index be5c3ff..68a0f54 100644
--- a/src/lib/hashtable.c
+++ b/src/lib/hashtable.c
@@ -20,6 +20,10 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#endif
+
#include <ouroboros/hashtable.h>
#include <ouroboros/list.h>
#include <ouroboros/errno.h>
diff --git a/src/lib/irm.c b/src/lib/irm.c
index 6a9f837..bd34669 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -20,7 +20,11 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200809L
+#endif
#include <ouroboros/errno.h>
#include <ouroboros/hash.h>
diff --git a/src/lib/md5.c b/src/lib/md5.c
index 6f2b2e3..959865f 100644
--- a/src/lib/md5.c
+++ b/src/lib/md5.c
@@ -40,6 +40,10 @@
* or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk!
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#endif
+
#include <ouroboros/endian.h>
#include <ouroboros/md5.h>
diff --git a/src/lib/sha3.c b/src/lib/sha3.c
index 6179af2..f6a82c5 100644
--- a/src/lib/sha3.c
+++ b/src/lib/sha3.c
@@ -42,6 +42,10 @@
* or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk!
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#endif
+
#include <ouroboros/endian.h>
#include <ouroboros/sha3.h>