From caaef4ac071146553ae25a60111e3ef1fc9a3b84 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 23 May 2018 00:17:02 +0200 Subject: [PATCH] tests: enable _DARWIN_C_SOURCE globally in order to fix compiler errors --- Makefile | 4 ++++ lib/Makefile.inc | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 31eacd39c..23cc84d0f 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,10 @@ LDLIBS = CFLAGS += -std=c11 -MMD -mcx16 -I$(BUILDDIR)/include -I$(SRCDIR)/include CFLAGS += -Wall -Werror -fdiagnostics-color=auto -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 +ifeq ($(PLATFORM),Darwin) + CFLAGS += -D_DARWIN_C_SOURCE +endif + LDFLAGS += -L$(BUILDDIR) # Some tools diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 48f0c1d13..29e513a41 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -26,10 +26,6 @@ LIBS = $(patsubst %, lib%, $(SONAMES)) LIB_CFLAGS += $(CFLAGS) -fPIC -ifeq ($(shell uname),Darwin) - LIB_CFLAGS += -D_DARWIN_C_SOURCE=1 -endif - include $(patsubst %, lib/Makefile.%.inc, $(SONAMES)) $(BUILDDIR)/include/villas/config.h: include/villas/config.h.in Makefile.config | $$(dir $$@)