]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Portability to systems which define uintmax_t in stdint.h, not inttypes.h.
authorBruno Haible <bruno@clisp.org>
Tue, 6 Nov 2001 18:42:28 +0000 (18:42 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 20:53:58 +0000 (22:53 +0200)
m4/ChangeLog
m4/Makefile.am
m4/mkdtemp.m4
m4/stdint_h.m4 [new file with mode: 0644]
m4/uintmax_t.m4

index 00a0db061655e9525c75d11c170fd6695e92aa7d..3ef153b8b0096f2533ce6d43438b3c8a286e88bb 100644 (file)
@@ -1,3 +1,13 @@
+2001-11-05  Bruno Haible  <haible@clisp.cons.org>
+
+       * stdint_h.m4: New file.
+       * Makefile.am (EXTRA_DIST): Add it.
+       * uintmax_t.m4 (jm_AC_TYPE_UINTMAX_T): Require also
+       jm_AC_HEADER_STDINT_H.
+       * mkdtemp.m4 (gt_FUNC_MKDTEMP): Call jm_AC_HEADER_INTTYPES_H instead
+       of testing for inttypes.h. Call jm_AC_HEADER_STDINT_H instead of
+       testing for stdint.h.
+
 2001-11-01  Bruno Haible  <haible@clisp.cons.org>
 
        * javacomp.m4 (gt_JAVACOMP): Test for the existence of gcj, javac,
index 551cfdfd51a5a3293fd6dbe029936ebe2c9f1e05..3376282a69f6b9757bb2f91080d123ab8ab291c7 100644 (file)
@@ -11,5 +11,5 @@ backupfile.m4 c-bs-a.m4 codeset.m4 flex.m4 getline.m4 gettext.m4 \
 glibc21.m4 hostname.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 javacomp.m4 \
 javaexec.m4 lcmessage.m4 libtool.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 \
 mkdtemp.m4 progtest.m4 setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 \
-signed.m4 ssize_t.m4 stdbool.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 \
-unionwait.m4
+signed.m4 ssize_t.m4 stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 \
+ulonglong.m4 unionwait.m4
index 8ee7ff97f020a6981b985d0a43fd659fcfeb7788..4b57115c6f8c97a3e1e1867e58ffb39087ce5aef 100644 (file)
@@ -6,6 +6,8 @@ AC_DEFUN([gt_FUNC_MKDTEMP],
 [
   AC_REPLACE_FUNCS(mkdtemp)
   AC_STAT_MACROS_BROKEN
-  AC_CHECK_HEADERS(fcntl.h inttypes.h stdint.h sys/time.h time.h unistd.h)
+  jm_AC_HEADER_INTTYPES_H
+  jm_AC_HEADER_STDINT_H
+  AC_CHECK_HEADERS(fcntl.h sys/time.h time.h unistd.h)
   AC_CHECK_FUNCS(gettimeofday)
 ])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
new file mode 100644 (file)
index 0000000..53d6468
--- /dev/null
@@ -0,0 +1,22 @@
+#serial 1
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <stdint.h>],
+    [uintmax_t i = (uintmax_t) -1;],
+    jm_ac_cv_header_stdint_h=yes,
+    jm_ac_cv_header_stdint_h=no)])
+  if test $jm_ac_cv_header_stdint_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_STDINT_H, 1,
+[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+   and declares uintmax_t. ])
+  fi
+])
index 470b816600ed318606c3e2a7c89c414cb03ac8ec..a9c079233b0d6d429dffaf3e7b365e3f12f2a113 100644 (file)
@@ -1,4 +1,4 @@
-#serial 5
+#serial 6
 
 dnl From Paul Eggert.
 
@@ -10,13 +10,14 @@ AC_PREREQ(2.13)
 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
 [
   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
-  if test $jm_ac_cv_header_inttypes_h = no; then
+  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
     AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
     test $ac_cv_type_unsigned_long_long = yes \
       && ac_type='unsigned long long' \
       || ac_type='unsigned long'
     AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
   [Define to unsigned long or unsigned long long
-   if <inttypes.h> doesn't define.])
+   if <inttypes.h> and <stdint.h> don't define.])
   fi
 ])