From d94b6146f2074608fba07421dd6185ac3a296680 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 26 Jun 2013 07:03:32 +0000 Subject: compatibility issue for MacOS X --- src/runtime/c/pgf/lightning/i386/funcs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/runtime/c/pgf/lightning') 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 #include #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); -- cgit v1.2.3