Blame m4/intmax.m4

Packit f546b1
# intmax.m4 serial 3 (gettext-0.16)
Packit f546b1
dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
Packit f546b1
dnl This file is free software; the Free Software Foundation
Packit f546b1
dnl gives unlimited permission to copy and/or distribute it,
Packit f546b1
dnl with or without modifications, as long as this notice is preserved.
Packit f546b1
Packit f546b1
dnl From Bruno Haible.
Packit f546b1
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
Packit f546b1
dnl find a replacement if it is lacking.
Packit f546b1
Packit f546b1
AC_DEFUN([gt_TYPE_INTMAX_T],
Packit f546b1
[
Packit f546b1
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
Packit f546b1
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
Packit f546b1
  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
Packit f546b1
    [AC_TRY_COMPILE([
Packit f546b1
#include <stddef.h>
Packit f546b1
#include <stdlib.h>
Packit f546b1
#if HAVE_STDINT_H_WITH_UINTMAX
Packit f546b1
#include <stdint.h>
Packit f546b1
#endif
Packit f546b1
#if HAVE_INTTYPES_H_WITH_UINTMAX
Packit f546b1
#include <inttypes.h>
Packit f546b1
#endif
Packit f546b1
],     [intmax_t x = -1;
Packit f546b1
        return !x;],
Packit f546b1
       gt_cv_c_intmax_t=yes,
Packit f546b1
       gt_cv_c_intmax_t=no)])
Packit f546b1
  if test $gt_cv_c_intmax_t = yes; then
Packit f546b1
    AC_DEFINE(HAVE_INTMAX_T, 1,
Packit f546b1
      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
Packit f546b1
  fi
Packit f546b1
])