From 8ddf72164b854c53086d3fb36288167d387fcab2 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Mon, 25 Jan 2016 22:11:13 +0100 Subject: [PATCH] _DARWIN_C_SOURCE must be defined when compiling for Mac with -std=c99 --- _gnu-make/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_gnu-make/Makefile b/_gnu-make/Makefile index ef782c7..e04fea6 100644 --- a/_gnu-make/Makefile +++ b/_gnu-make/Makefile @@ -30,11 +30,15 @@ buildir := $(realpath .)/build binsubdir := $(platform)-$(architecture) bindir := $(prefix)/bin/$(binsubdir) -CFLAGS := -O2 -g -Wall -pedantic -Werror -std=c99 -D_XOPEN_SOURCE=500 +CFLAGS := -O2 -g -Wall -pedantic -Werror -std=c99 CXXFLAGS := -O2 -g -Wall -pedantic -Werror ifeq ($(platform),linux) override LDFLAGS := $(LDFLAGS) -ldl +CFLAGS +=-D_XOPEN_SOURCE=500 +endif +ifeq ($(platform),mac) +CFLAGS +=-D_DARWIN_C_SOURCE endif ifeq ($(platform),mac)