Don't include sys/mman.h when not using mprotect

This commit is contained in:
Nikos Chantziaras 2019-11-25 13:26:30 +02:00
parent 0d87e92a10
commit d094c21824
4 changed files with 12 additions and 4 deletions

View File

@ -6,7 +6,9 @@
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/mman.h>
#ifdef LIBCO_MPROTECT
#include <sys/mman.h>
#endif
#ifdef __cplusplus
extern "C" {

View File

@ -99,7 +99,9 @@ static void (*co_swap)(cothread_t, cothread_t) = 0;
};
#include <unistd.h>
#include <sys/mman.h>
#ifdef LIBCO_MPROTECT
#include <sys/mman.h>
#endif
static void co_init() {
#ifdef LIBCO_MPROTECT

4
arm.c
View File

@ -5,7 +5,9 @@
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#ifdef LIBCO_MPROTECT
#include <sys/mman.h>
#endif
#ifdef __cplusplus
extern "C" {

4
x86.c
View File

@ -53,7 +53,9 @@ static const unsigned char co_swap_function[4096] = {
}
#else
#include <unistd.h>
#include <sys/mman.h>
#ifdef LIBCO_MPROTECT
#include <sys/mman.h>
#endif
static void co_init() {
#ifdef LIBCO_MPROTECT