]> Savannah Git Hosting - gnulib.git/commitdiff
Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64.
authorBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2019 01:12:53 +0000 (02:12 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2019 01:12:53 +0000 (02:12 +0100)
* 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.

ChangeLog
m4/largefile.m4
modules/fflush
modules/fseeko
modules/ftello

index 903e56c236d50736f29ccdc6babe7f643b85719c..d4ca157cf5ef7c756fd01c7aae6d9e680490c017 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-12-08  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Fix compilation error in C++ mode on HP-UX 11.
index c6dd9a10032e740cf5569526782a621e3e35088c..65d5a15183e5712df532be65a3236ce2b4536848 100644 (file)
@@ -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 <stdio.h> 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.
index 03b2f1d1d4840c3e0a7038860896c4c3b96a57cc..858a25aaf278055103fb6b00aa951947bcdf66e6 100644 (file)
@@ -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
index d4cc1628454e3a85d7a1c0713503ee4fe1c5a363..83db09cc301eec9c7d67bfde921d61c37c9fb71d 100644 (file)
@@ -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
index 1680f2da0fc0adab326c926da4d32d5393afc31d..6de0859f8e60ef61d76581eb8a54618c4d18a37c 100644 (file)
@@ -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