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:
parent
a4528f3d8c
commit
4f0e4dec90
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user