From d29ca4559565d93b829312293630aa1a110382a1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 30 Nov 1997 13:35:35 +0000 Subject: [PATCH] . --- m4/inttypes_h.m4 | 20 ++++++++++++++++++++ m4/uintmax_t.m4 | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 m4/inttypes_h.m4 create mode 100644 m4/uintmax_t.m4 diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 new file mode 100644 index 0000000..c020f41 --- /dev/null +++ b/m4/inttypes_h.m4 @@ -0,0 +1,20 @@ +#serial 1 + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN(jm_AC_HEADER_INTTYPES_H, +[ + AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_inttypes_h=yes, + jm_ac_cv_header_inttypes_h=no)]) + if test $jm_ac_cv_header_inttypes_h = yes; then + AC_DEFINE(HAVE_INTTYPES_H) + fi +]) diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 new file mode 100644 index 0000000..b9855a6 --- /dev/null +++ b/m4/uintmax_t.m4 @@ -0,0 +1,23 @@ +#serial 1 + +dnl From Paul Eggert. + +# Define uintmax_t to `unsigned long' or `unsigned long long' +# if does not exist. + +AC_DEFUN(jm_AC_TYPE_UINTMAX_T, +[ + AC_REQUIRE([jm_AC_HEADER_INTTTYPES_H]) + if test $jm_ac_cv_header_inttypes_h = no; then + AC_CACHE_CHECK(for unsigned long long, ac_cv_type_unsigned_long_long, + [AC_TRY_COMPILE([], + [unsigned long long i = (unsigned long long) -1;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(uintmax_t, unsigned long long) + else + AC_DEFINE(uintmax_t, unsigned long) + fi + fi +]) -- 2.7.4