From: Bruno Haible Date: Tue, 6 Nov 2001 18:42:28 +0000 (+0000) Subject: Portability to systems which define uintmax_t in stdint.h, not inttypes.h. X-Git-Tag: v0.11~323 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19e84d3e7efebf13a7fdf99a2b8cfa9a9380d715;p=thirdparty%2Fgettext.git Portability to systems which define uintmax_t in stdint.h, not inttypes.h. --- diff --git a/m4/ChangeLog b/m4/ChangeLog index 00a0db061..3ef153b8b 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,13 @@ +2001-11-05 Bruno Haible + + * 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 * javacomp.m4 (gt_JAVACOMP): Test for the existence of gcj, javac, diff --git a/m4/Makefile.am b/m4/Makefile.am index 551cfdfd5..3376282a6 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -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 diff --git a/m4/mkdtemp.m4 b/m4/mkdtemp.m4 index 8ee7ff97f..4b57115c6 100644 --- a/m4/mkdtemp.m4 +++ b/m4/mkdtemp.m4 @@ -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 index 000000000..53d646856 --- /dev/null +++ b/m4/stdint_h.m4 @@ -0,0 +1,22 @@ +#serial 1 + +dnl From Paul Eggert. + +# Define HAVE_STDINT_H if exists, +# doesn't clash with , 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 +#include ], + [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 exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 index 470b81660..a9c079233 100644 --- a/m4/uintmax_t.m4 +++ b/m4/uintmax_t.m4 @@ -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 doesn't define.]) + if and don't define.]) fi ])