bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix compilation error in C++ mode on HP-UX 11


From: Bruno Haible
Subject: fix compilation error in C++ mode on HP-UX 11
Date: Sun, 08 Dec 2019 22:54:29 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )

On HP-UX 11, a testdir built with --with-c++-tests produces a number of
errors about functions being undeclared. Which functions, depends on the
compiler options. The least number of such undeclared function errors
occur with the options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600. In this case,
one error remains:

"../gllib/unistd.h", line 1442: error #2282: the global scope has no
          "getpagesize"
  _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
                         ^

This patch fixes it.


2019-12-08  Bruno Haible  <address@hidden>

        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.

diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 2fa25b4..c57d6f9 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 <unistd.h> 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.  */
diff --git a/doc/glibc-functions/getpagesize.texi 
b/doc/glibc-functions/getpagesize.texi
index 74273ba..1538a1e 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]