build: avoid redefining _DEFAULT_SOURCE
authorJo-Philipp Wich <jo@mein.io>
Thu, 23 Aug 2018 07:36:06 +0000 (09:36 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 23 Aug 2018 07:36:06 +0000 (09:36 +0200)
Work around further glibc toolchain annoyances.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
file.c
main.c

diff --git a/file.c b/file.c
index 2f829f158ce78d81411cd08cc3dde109d1ba2d10..b73fd474332f3518d93824fd993f8ffe6e43752b 100644 (file)
--- a/file.c
+++ b/file.c
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define _DEFAULT_SOURCE
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#define
+
 #define _BSD_SOURCE
 #define _DARWIN_C_SOURCE
 #define _XOPEN_SOURCE 700
diff --git a/main.c b/main.c
index 6574c15ec8d9fda65299995a28b525a0a2b7833c..219e37e9c349b6873bd2afccd302d4c345a17ec7 100644 (file)
--- a/main.c
+++ b/main.c
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define _DEFAULT_SOURCE
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#endif
+
 #define _BSD_SOURCE
 #define _GNU_SOURCE
 #define _XOPEN_SOURCE  700