Blame m4/inttypes_h.m4

Packit 33f14e
# inttypes_h.m4 serial 10
Packit 33f14e
dnl Copyright (C) 1997-2004, 2006, 2008-2017 Free Software Foundation, Inc.
Packit 33f14e
dnl This file is free software; the Free Software Foundation
Packit 33f14e
dnl gives unlimited permission to copy and/or distribute it,
Packit 33f14e
dnl with or without modifications, as long as this notice is preserved.
Packit 33f14e
Packit 33f14e
dnl From Paul Eggert.
Packit 33f14e
Packit 33f14e
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
Packit 33f14e
# doesn't clash with <sys/types.h>, and declares uintmax_t.
Packit 33f14e
Packit 33f14e
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
Packit 33f14e
[
Packit 33f14e
  AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
Packit 33f14e
    [AC_COMPILE_IFELSE(
Packit 33f14e
       [AC_LANG_PROGRAM(
Packit 33f14e
          [[
Packit 33f14e
#include <sys/types.h>
Packit 33f14e
#include <inttypes.h>
Packit 33f14e
          ]],
Packit 33f14e
          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
Packit 33f14e
       [gl_cv_header_inttypes_h=yes],
Packit 33f14e
       [gl_cv_header_inttypes_h=no])])
Packit 33f14e
  if test $gl_cv_header_inttypes_h = yes; then
Packit 33f14e
    AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
Packit 33f14e
      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
Packit 33f14e
       and declares uintmax_t. ])
Packit 33f14e
  fi
Packit 33f14e
])