[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getpagesize on mingw
From: |
Bruno Haible |
Subject: |
getpagesize on mingw |
Date: |
Sat, 3 Apr 2010 14:44:14 +0100 |
User-agent: |
KMail/1.9.9 |
Similarly, I'm seeing this error in C++ mode on mingw:
../gllib/unistd.h:1042: error: `getpagesize' was not declared in this scope
This fixes it:
2010-04-03 Bruno Haible <address@hidden>
getpagesize: Fix C++ test error on mingw.
* lib/unistd.in.h (getpagesize): Don't use _GL_CXXALIASWARN if the
system does not declare the function.
* m4/getpagesize.m4 (gl_FUNC_GETPAGESIZE): Also check whether it's
declared.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
HAVE_DECL_GETPAGESIZE.
* modules/unistd (Makefile.am): Substitute HAVE_DECL_GETPAGESIZE.
--- lib/unistd.in.h.orig Sat Apr 3 15:36:15 2010
+++ lib/unistd.in.h Sat Apr 3 15:06:27 2010
@@ -775,7 +775,9 @@
/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t.
*/
_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
# endif
+# if @HAVE_DECL_GETPAGESIZE@
_GL_CXXALIASWARN (getpagesize);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getpagesize
# if HAVE_RAW_DECL_GETPAGESIZE
--- m4/getpagesize.m4.orig Sat Apr 3 15:36:15 2010
+++ m4/getpagesize.m4 Sat Apr 3 15:35:52 2010
@@ -1,4 +1,4 @@
-# getpagesize.m4 serial 7
+# getpagesize.m4 serial 8
dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -27,4 +27,7 @@
AC_LIBOBJ([getpagesize])
;;
esac
+ dnl Also check whether it's declared.
+ dnl mingw has getpagesize() in libgcc.a but doesn't declare it.
+ AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0])
])
--- m4/unistd_h.m4.orig Sat Apr 3 15:36:15 2010
+++ m4/unistd_h.m4 Sat Apr 3 15:07:45 2010
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 43
+# unistd_h.m4 serial 44
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -122,6 +122,7 @@
HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
+ HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
--- modules/unistd.orig Sat Apr 3 15:36:15 2010
+++ modules/unistd Sat Apr 3 15:07:24 2010
@@ -96,6 +96,7 @@
-e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- stpncpy on mingw, Bruno Haible, 2010/04/03
- mkstemp on mingw, Bruno Haible, 2010/04/03
- fseeko on mingw, Bruno Haible, 2010/04/03
- ftello on mingw, Bruno Haible, 2010/04/03
- getline on mingw, Bruno Haible, 2010/04/03
- getpagesize on mingw,
Bruno Haible <=
- fchdir on mingw, Bruno Haible, 2010/04/03
- nanosleep on mingw, Bruno Haible, 2010/04/03
- Re: nanosleep on mingw, Bruno Haible, 2010/04/04
- Re: nanosleep on mingw, Jim Meyering, 2010/04/04
- Re: nanosleep on mingw, Bruno Haible, 2010/04/04
localtime_r on mingw, Bruno Haible, 2010/04/03
timegm on mingw, Bruno Haible, 2010/04/03