mirror of
https://github.com/gosticks/RIOT.git
synced 2026-12-04 12:11:48 +00:00
fix ucontext.h include for OSX, FreeBSD
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user