Blame m4/inttypes_h.m4

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