*** empty log message ***
[findutils.git] / m4 / inttypes_h.m4
blob4ccd7ce4dc36a7e5b09df6782619fd8099431be7
1 #serial 2
3 dnl From Paul Eggert.
5 # Define HAVE_INTTYPES_H if <inttypes.h> exists,
6 # doesn't clash with <sys/types.h>, and declares uintmax_t.
8 AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
10   if test x = y; then
11     dnl This code is deliberately never run via ./configure.
12     dnl FIXME: this is a gross hack to make autoheader put an entry
13     dnl for `HAVE_INTTYPES_H' in config.h.in.
14     AC_CHECK_FUNCS(INTTYPES_H)
15   fi
16   AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
17   [AC_TRY_COMPILE(
18     [#include <sys/types.h>
19 #include <inttypes.h>],
20     [uintmax_t i = (uintmax_t) -1;],
21     jm_ac_cv_header_inttypes_h=yes,
22     jm_ac_cv_header_inttypes_h=no)])
23   if test $jm_ac_cv_header_inttypes_h = yes; then
24     ac_kludge=HAVE_INTTYPES_H
25     AC_DEFINE_UNQUOTED($ac_kludge)
26   fi