Blame gettext-runtime/m4/intmax.m4

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