diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-06-26 07:03:32 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-06-26 07:03:32 +0000 |
| commit | d94b6146f2074608fba07421dd6185ac3a296680 (patch) | |
| tree | 75bfdd806281cae94cae3686d80f5d807c594c11 /src/runtime/c/pgf/lightning | |
| parent | 3a22258109384ac509f26ecd022ce97687eca0ec (diff) | |
compatibility issue for MacOS X
Diffstat (limited to 'src/runtime/c/pgf/lightning')
| -rw-r--r-- | src/runtime/c/pgf/lightning/i386/funcs.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/c/pgf/lightning/i386/funcs.h b/src/runtime/c/pgf/lightning/i386/funcs.h index c35849956..bd9bfac4f 100644 --- a/src/runtime/c/pgf/lightning/i386/funcs.h +++ b/src/runtime/c/pgf/lightning/i386/funcs.h @@ -34,7 +34,7 @@ #ifndef __lightning_funcs_h #define __lightning_funcs_h -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) #include <unistd.h> #include <sys/mman.h> #endif @@ -51,7 +51,7 @@ jit_flush_code(void *dest, void *end) execution of the data and stack segment are becoming more and more common (Fedora, for example), so we implement our jit_flush_code as an mprotect. */ -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) static unsigned long prev_page = 0, prev_length = 0; unsigned long page, length; #ifdef PAGESIZE @@ -59,7 +59,7 @@ jit_flush_code(void *dest, void *end) #else static int page_size = -1; if (page_size == -1) - page_size = sysconf (_SC_PAGESIZE); + page_size = getpagesize(); #endif page = (long) dest & ~(page_size - 1); |
