diff --git a/cpu/native/include/cpu.h b/cpu/native/include/cpu.h index 2a51e9deef..2f5ba22af9 100644 --- a/cpu/native/include/cpu.h +++ b/cpu/native/include/cpu.h @@ -19,12 +19,22 @@ #ifndef _CPU_H #define _CPU_H -#ifdef __MACH__ +#include + +/* enable signal handler register access on different platforms + * check here for more: + * http://sourceforge.net/p/predef/wiki/OperatingSystems/ + */ +#ifdef BSD // BSD = (FreeBSD, Darwin, ...) #define _XOPEN_SOURCE +#elif defined(__linux__) +#define __USE_GNU #endif #include -#ifdef __MACH__ +#ifdef BSD #undef _XOPEN_SOURCE +#elif defined(__linux__) +#undef __USE_GNU #endif #include "kernel_intern.h" diff --git a/cpu/native/irq_cpu.c b/cpu/native/irq_cpu.c index fed715f935..dc3222853b 100644 --- a/cpu/native/irq_cpu.c +++ b/cpu/native/irq_cpu.c @@ -16,9 +16,8 @@ #include #include -// __USE_GNU for gregs[REG_EIP] access +// __USE_GNU for gregs[REG_EIP] access under Linux #define __USE_GNU -#include #include #undef __USE_GNU