[PATCH:libXaw 2/2] Check for getpagesize() with autoconf instead of #ifdef osname

Alan Coopersmith alan.coopersmith at oracle.com
Sat Nov 20 20:11:13 PST 2010


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac |    2 +-
 src/OS.c     |   11 +----------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 83b20b2..d8069cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,7 +93,7 @@ AC_HEADER_STDC
 AC_CHECK_HEADERS([wctype.h wchar.h widec.h])
 
 # Checks for functions
-AC_CHECK_FUNCS([iswalnum])
+AC_CHECK_FUNCS([iswalnum getpagesize])
 
 AC_OUTPUT([Makefile
 	  include/Makefile
diff --git a/src/OS.c b/src/OS.c
index 9c0bb45..8bc23dd 100644
--- a/src/OS.c
+++ b/src/OS.c
@@ -14,18 +14,9 @@
 #if defined(linux)
 /* kernel header doesn't work with -ansi */
 /* #include <asm/page.h> *//* for PAGE_SIZE */
-#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
-
 int
 _XawGetPageSize(void)
 {
@@ -45,7 +36,7 @@ _XawGetPageSize(void)
 	pagesize = sysconf(_SC_PAGE_SIZE);
 #endif
 
-#ifdef HAS_GETPAGESIZE
+#ifdef HAVE_GETPAGESIZE
     if (pagesize == -1)
 	pagesize = getpagesize();
 #endif
-- 
1.7.3.2



More information about the xorg-devel mailing list