1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

fix ucontext.h include for OSX, FreeBSD

This commit is contained in:
Ludwig Ortmann 2013-06-03 13:10:42 +02:00
parent a4528f3d8c
commit 4f0e4dec90
2 changed files with 13 additions and 4 deletions

View File

@ -19,12 +19,22 @@
#ifndef _CPU_H
#define _CPU_H
#ifdef __MACH__
#include <sys/param.h>
/* 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 <ucontext.h>
#ifdef __MACH__
#ifdef BSD
#undef _XOPEN_SOURCE
#elif defined(__linux__)
#undef __USE_GNU
#endif
#include "kernel_intern.h"

View File

@ -16,9 +16,8 @@
#include <string.h>
#include <unistd.h>
// __USE_GNU for gregs[REG_EIP] access
// __USE_GNU for gregs[REG_EIP] access under Linux
#define __USE_GNU
#include <ucontext.h>
#include <signal.h>
#undef __USE_GNU