bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 1/4] strtoimax, strtoumax: simplify, port to HP-UX 11.00 64-bit


From: Paul Eggert
Subject: [PATCH 1/4] strtoimax, strtoumax: simplify, port to HP-UX 11.00 64-bit
Date: Mon, 25 Apr 2011 21:58:22 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

This supports apps that need pointers to strtoimax and strtoumax,
and ports to HP-UX 11.00 64.bit, which has macros that expand to
nonexistent functions.  See
<http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00241.html>
et seq.
* lib/inttypes.in.h (strtoimax, strtoumax): #undef before declaring.
* m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Don't check whether it's
a macro.  Check whether it's declared instead.
* m4/strtoumax.m4 (gl_FUNC_STRTOUMAX): Likewise.
---
 ChangeLog         |   13 +++++++++++++
 lib/inttypes.in.h |    2 ++
 m4/strtoimax.m4   |   16 ++++++----------
 m4/strtoumax.m4   |   16 ++++++----------
 4 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4fcc308..791cf67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-04-25  Paul Eggert  <address@hidden>
+
+       strtoimax, strtoumax: simplify, port to HP-UX 11.00 64-bit
+       This supports apps that need pointers to strtoimax and strtoumax,
+       and ports to HP-UX 11.00 64.bit, which has macros that expand to
+       nonexistent functions.  See
+       <http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00241.html>
+       et seq.
+       * lib/inttypes.in.h (strtoimax, strtoumax): #undef before declaring.
+       * m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Don't check whether it's
+       a macro.  Check whether it's declared instead.
+       * m4/strtoumax.m4 (gl_FUNC_STRTOUMAX): Likewise.
+
 2011-04-25  Simon Josefsson  <address@hidden>
 
        * modules/gnumakefile (configure.ac): Replace TAB with SPCs.
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index 6a8f46d..7abf394 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -1076,6 +1076,7 @@ _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
 
 #if @GNULIB_STRTOIMAX@
 # if address@hidden@
+#  undef strtoimax
 extern intmax_t strtoimax (const char *, char **, int) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -1088,6 +1089,7 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
 
 #if @GNULIB_STRTOUMAX@
 # if address@hidden@
+#  undef strtoumax
 extern uintmax_t strtoumax (const char *, char **, int) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4
index e82e7cd..d46673b 100644
--- a/m4/strtoimax.m4
+++ b/m4/strtoimax.m4
@@ -1,4 +1,4 @@
-# strtoimax.m4 serial 8
+# strtoimax.m4 serial 9
 dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,16 +6,12 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_FUNC_STRTOIMAX],
 [
-  AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
-    gl_cv_func_strtoimax_macro,
-    [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
-#ifdef strtoimax
- inttypes_h_defines_strtoimax
-#endif],
-       gl_cv_func_strtoimax_macro=yes,
-       gl_cv_func_strtoimax_macro=no)])
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+
+  AC_CHECK_DECLS_ONCE([strtoimax])
+  if test "$ac_cv_have_decl_strtoimax" != yes; then
+    HAVE_DECL_STRTOIMAX=0
 
-  if test "$gl_cv_func_strtoimax_macro" != yes; then
     AC_REPLACE_FUNCS([strtoimax])
     if test $ac_cv_func_strtoimax = no; then
       gl_PREREQ_STRTOIMAX
diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4
index 448c4d9..7fa5636 100644
--- a/m4/strtoumax.m4
+++ b/m4/strtoumax.m4
@@ -1,4 +1,4 @@
-# strtoumax.m4 serial 8
+# strtoumax.m4 serial 9
 dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,16 +6,12 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_FUNC_STRTOUMAX],
 [
-  AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
-    gl_cv_func_strtoumax_macro,
-    [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
-#ifdef strtoumax
- inttypes_h_defines_strtoumax
-#endif],
-       gl_cv_func_strtoumax_macro=yes,
-       gl_cv_func_strtoumax_macro=no)])
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+
+  AC_CHECK_DECLS_ONCE([strtoumax])
+  if test "$ac_cv_have_decl_strtoumax" != yes; then
+    HAVE_DECL_STRTOUMAX=0
 
-  if test "$gl_cv_func_strtoumax_macro" != yes; then
     AC_REPLACE_FUNCS([strtoumax])
     if test $ac_cv_func_strtoumax = no; then
       gl_PREREQ_STRTOUMAX
-- 
1.7.4.4





reply via email to

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