From e867d83effd9089343c3b7c8d5c33dda804e5b44 Mon Sep 17 00:00:00 2001 From: smlng Date: Thu, 10 Nov 2016 14:30:55 +0100 Subject: [PATCH] cbor: fix redefined macro error on macOS --- cpu/native/Makefile.include | 2 +- sys/cbor/Makefile | 3 +++ sys/include/cbor.h | 5 ----- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cpu/native/Makefile.include b/cpu/native/Makefile.include index 890d558293..638fa148d4 100644 --- a/cpu/native/Makefile.include +++ b/cpu/native/Makefile.include @@ -8,5 +8,5 @@ endif export USEMODULE += periph ifeq ($(shell uname -s),Darwin) -export CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE +export CFLAGS += -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE endif diff --git a/sys/cbor/Makefile b/sys/cbor/Makefile index ea880700a7..871bd3925d 100644 --- a/sys/cbor/Makefile +++ b/sys/cbor/Makefile @@ -1,6 +1,9 @@ MODULE = cbor CFLAGS += -DCBOR_NO_PRINT +ifneq ($(shell uname -s),Darwin) + CFLAGS += -D_XOPEN_SOURCE=600 +endif ifeq (,$(filter native,$(BOARD))) # build the minimal subset for non-native diff --git a/sys/include/cbor.h b/sys/include/cbor.h index f47eeedad3..9b59dbf972 100644 --- a/sys/include/cbor.h +++ b/sys/include/cbor.h @@ -101,11 +101,6 @@ #ifndef CBOR_H #define CBOR_H -#ifndef CBOR_NO_CTIME -/* 'strptime' is only declared when this macro is defined */ -#define _XOPEN_SOURCE -#endif - #include #include #include