From 16e9d079c99026d6807ab3a42bb2175593f6dbc2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 Dec 2019 21:49:32 +0100 Subject: [PATCH] Fix compilation error in C++ mode on HP-UX 11. * lib/unistd.in.h (getpagesize): Declare on HP-UX. * doc/glibc-functions/getpagesize.texi: Mention the HP-UX problem. --- ChangeLog | 6 ++++++ doc/glibc-functions/getpagesize.texi | 3 +++ lib/unistd.in.h | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7b468512e1..903e56c236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-12-08 Bruno Haible + + Fix compilation error in C++ mode on HP-UX 11. + * lib/unistd.in.h (getpagesize): Declare on HP-UX. + * doc/glibc-functions/getpagesize.texi: Mention the HP-UX problem. + 2019-12-08 Bruno Haible Fix compilation errors on HP-UX 11/ia64. diff --git a/doc/glibc-functions/getpagesize.texi b/doc/glibc-functions/getpagesize.texi index 74273baa20..1538a1ec39 100644 --- a/doc/glibc-functions/getpagesize.texi +++ b/doc/glibc-functions/getpagesize.texi @@ -23,6 +23,9 @@ Portability problems fixed by Gnulib: This function is missing on some platforms: MSVC 14, Android 4.4. @item +This function is not declared on some platforms: +HP-UX 11 with compiler option @code{-D_XOPEN_SOURCE=600}. +@item This function is broken on some platforms: mingw. @end itemize diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 2fa25b4a75..c57d6f9ff3 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -905,6 +905,11 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " _GL_FUNCDECL_RPL (getpagesize, int, (void)); _GL_CXXALIAS_RPL (getpagesize, int, (void)); # else +/* On HP-UX, getpagesize exists, but it is not declared in even if + the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ +# if defined __hpux +_GL_FUNCDECL_SYS (getpagesize, int, (void)); +# endif # if !@HAVE_GETPAGESIZE@ # if !defined getpagesize /* This is for POSIX systems. */ -- 2.39.5