133965Sjdp# intmax.m4 serial 3 (gettext-0.16)
278828Sobriendnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
3218822Sdimdnl This file is free software; the Free Software Foundation
433965Sjdpdnl gives unlimited permission to copy and/or distribute it,
533965Sjdpdnl with or without modifications, as long as this notice is preserved.
633965Sjdp
733965Sjdpdnl From Bruno Haible.
833965Sjdpdnl Test whether the system has the 'intmax_t' type, but don't attempt to
933965Sjdpdnl find a replacement if it is lacking.
1033965Sjdp
1133965SjdpAC_DEFUN([gt_TYPE_INTMAX_T],
1233965Sjdp[
1333965Sjdp  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1433965Sjdp  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1533965Sjdp  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
1633965Sjdp    [AC_TRY_COMPILE([
1733965Sjdp#include <stddef.h>
1833965Sjdp#include <stdlib.h>
1933965Sjdp#if HAVE_STDINT_H_WITH_UINTMAX
20218822Sdim#include <stdint.h>
21218822Sdim#endif
2233965Sjdp#if HAVE_INTTYPES_H_WITH_UINTMAX
23130561Sobrien#include <inttypes.h>
24218822Sdim#endif
25218822Sdim],     [intmax_t x = -1;
26218822Sdim        return !x;],
27218822Sdim       gt_cv_c_intmax_t=yes,
2833965Sjdp       gt_cv_c_intmax_t=no)])
29218822Sdim  if test $gt_cv_c_intmax_t = yes; then
3033965Sjdp    AC_DEFINE(HAVE_INTMAX_T, 1,
3133965Sjdp      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3233965Sjdp  fi
3333965Sjdp])
3433965Sjdp