From: Bruno Haible Date: Mon, 9 Dec 2019 01:12:53 +0000 (+0100) Subject: Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64. X-Git-Tag: v1.0~4537 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=035e545a4f4cdd1b358810b2498541159b7e6bf1;p=gnulib.git Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64. * m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE): New macro. * modules/fseeko (configure.ac-early): Require it instead of AC_FUNC_FSEEKO. * modules/ftello (configure.ac-early): Likewise. * modules/fflush (configure.ac-early): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 903e56c236..d4ca157cf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2019-12-08 Bruno Haible + + Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64. + * m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE): New macro. + * modules/fseeko (configure.ac-early): Require it instead of + AC_FUNC_FSEEKO. + * modules/ftello (configure.ac-early): Likewise. + * modules/fflush (configure.ac-early): Likewise. + 2019-12-08 Bruno Haible Fix compilation error in C++ mode on HP-UX 11. diff --git a/m4/largefile.m4 b/m4/largefile.m4 index c6dd9a1003..65d5a15183 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -5,6 +5,22 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO: +# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this +# setting of _LARGEFILE_SOURCE is needed so that declares fseeko +# and ftello in C++ mode as well. +AC_DEFUN([gl_SET_LARGEFILE_SOURCE], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_FUNC_FSEEKO + case "$host_os" in + hpux*) + AC_DEFINE([_LARGEFILE_SOURCE], [1], + [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).]) + ;; + esac +]) + # The following implementation works around a problem in autoconf <= 2.69; # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, # or configures them incorrectly in some cases. diff --git a/modules/fflush b/modules/fflush index 03b2f1d1d4..858a25aaf2 100644 --- a/modules/fflush +++ b/modules/fflush @@ -17,7 +17,7 @@ unistd [test $REPLACE_FFLUSH = 1] fseeko [test $REPLACE_FFLUSH = 1] configure.ac-early: -AC_REQUIRE([AC_FUNC_FSEEKO]) +AC_REQUIRE([gl_SET_LARGEFILE_SOURCE]) configure.ac: gl_FUNC_FFLUSH diff --git a/modules/fseeko b/modules/fseeko index d4cc162845..83db09cc30 100644 --- a/modules/fseeko +++ b/modules/fseeko @@ -16,7 +16,7 @@ sys_types fseek configure.ac-early: -AC_REQUIRE([AC_FUNC_FSEEKO]) +AC_REQUIRE([gl_SET_LARGEFILE_SOURCE]) configure.ac: gl_FUNC_FSEEKO diff --git a/modules/ftello b/modules/ftello index 1680f2da0f..6de0859f8e 100644 --- a/modules/ftello +++ b/modules/ftello @@ -17,7 +17,7 @@ lseek [test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1] ftell configure.ac-early: -AC_REQUIRE([AC_FUNC_FSEEKO]) +AC_REQUIRE([gl_SET_LARGEFILE_SOURCE]) configure.ac: gl_FUNC_FTELLO