changeset 5365:192b28b0d8e2

getpagesize module shouldn't assume sys/param.h exists.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 22 Oct 2004 22:28:36 +0000
parents 357857397498
children 9051d3298e83
files lib/ChangeLog lib/getpagesize.h m4/ChangeLog m4/getpagesize.m4
diffstat 4 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,9 @@
 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
 
+	* getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
+	It's now the caller's responsibility to handle the case where
+	!HAVE_GETPAGESIZE && !defined getpagesize.
+
 	* mktime.c (leapyear): Arg is long int, not int.
 
 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
--- a/lib/getpagesize.h
+++ b/lib/getpagesize.h
@@ -1,5 +1,5 @@
 /* Emulate getpagesize on systems that lack it.
-   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
 # endif
 #endif
 
-#ifndef getpagesize
+#if !defined getpagesize && HAVE_SYS_PARAM_H
 # include <sys/param.h>
 # ifdef EXEC_PAGESIZE
 #  define getpagesize() EXEC_PAGESIZE
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,7 @@
+2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* getpagesize.m4 (gl_GETPAGESIZE): Check for <sys/param.h>.
+
 2004-10-15  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* getopt.m4 (gl_GETOPT): Detect and reject the incompatible BSD
--- a/m4/getpagesize.m4
+++ b/m4/getpagesize.m4
@@ -1,5 +1,5 @@
-# getpagesize.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# getpagesize.m4 serial 2
+dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -9,7 +9,7 @@
 AC_DEFUN([gl_GETPAGESIZE],
 [
   dnl Prerequisites of lib/getpagesize.h.
-  AC_CHECK_HEADERS_ONCE(unistd.h)
+  AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
   AC_CHECK_HEADERS(OS.h)
   AC_CHECK_FUNCS(getpagesize)
 ])