Blame m4/intmax.m4

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