diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-09-09 20:26:15 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-09-09 20:26:15 -0700 |
commit | 4c63319d249cb796b735ec56904c088c56a5171f (patch) | |
tree | f00f62f8eedca10ef7071f5601a0ead8f2d43745 /lisp | |
parent | 9f0f4a2c5495eec2d81a4381fb962fad93b2ddde (diff) |
Check for pagesize options via autoconf instead of per-platform #ifdefs
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/lisp.c | 29 | ||||
-rw-r--r-- | lisp/private.h | 1 |
2 files changed, 7 insertions, 23 deletions
diff --git a/lisp/lisp.c b/lisp/lisp.c index b999b8a..a533beb 100644 --- a/lisp/lisp.c +++ b/lisp/lisp.c @@ -29,6 +29,10 @@ /* $XFree86: xc/programs/xedit/lisp/lisp.c,v 1.87tsi Exp $ */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <stdlib.h> #include <string.h> #ifdef sun @@ -45,27 +49,6 @@ #include <unistd.h> /* for sysconf(), and getpagesize() */ #endif -#if defined(linux) -#define HAS_GETPAGESIZE -#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */ -#endif - -#if defined(CSRG_BASED) -#define HAS_GETPAGESIZE -#endif - -#if defined(sun) -#define HAS_GETPAGESIZE -#endif - -#if defined(QNX4) -#define HAS_GETPAGESIZE -#endif - -#if defined(__QNXNTO__) -#define HAS_SC_PAGESIZE -#endif - #include "lisp/bytecode.h" #include "lisp/read.h" @@ -636,7 +619,7 @@ LispGetPageSize(void) /* Try each supported method in the preferred order */ -#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE) +#if defined(_SC_PAGESIZE) || defined(HAVE_DECL__SC_PAGESIZE) pagesize = sysconf(_SC_PAGESIZE); #endif @@ -645,7 +628,7 @@ LispGetPageSize(void) pagesize = sysconf(_SC_PAGE_SIZE); #endif -#ifdef HAS_GETPAGESIZE +#ifdef HAVE_GETPAGESIZE if (pagesize == -1) pagesize = getpagesize(); #endif diff --git a/lisp/private.h b/lisp/private.h index f6aeff0..2cbdfc3 100644 --- a/lisp/private.h +++ b/lisp/private.h @@ -68,6 +68,7 @@ (LispObj *)lisp__data.features->data.atom->property->value : \ NIL) #define PACK lisp__data.packlist +#undef PACKAGE /* avoid conflicts with autoconf's #define in config.h */ #define PACKAGE lisp__data.package->data.atom->property->value #define MOD lisp__data.modlist #define COD lisp__data.codlist |