Blame m4/inttypes-pri.m4

Packit 8f70b4
# inttypes-pri.m4 serial 7 (gettext-0.18.2)
Packit 8f70b4
dnl Copyright (C) 1997-2002, 2006, 2008-2018 Free Software Foundation, Inc.
Packit 8f70b4
dnl This file is free software; the Free Software Foundation
Packit 8f70b4
dnl gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
dnl with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
dnl From Bruno Haible.
Packit 8f70b4
Packit 8f70b4
AC_PREREQ([2.53])
Packit 8f70b4
Packit 8f70b4
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
Packit 8f70b4
# macros to non-string values.  This is the case on AIX 4.3.3.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gt_INTTYPES_PRI],
Packit 8f70b4
[
Packit 8f70b4
  AC_CHECK_HEADERS([inttypes.h])
Packit 8f70b4
  if test $ac_cv_header_inttypes_h = yes; then
Packit 8f70b4
    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
Packit 8f70b4
      [gt_cv_inttypes_pri_broken],
Packit 8f70b4
      [
Packit 8f70b4
        AC_COMPILE_IFELSE(
Packit 8f70b4
          [AC_LANG_PROGRAM(
Packit 8f70b4
             [[
Packit 8f70b4
#include <inttypes.h>
Packit 8f70b4
#ifdef PRId32
Packit 8f70b4
char *p = PRId32;
Packit 8f70b4
#endif
Packit 8f70b4
             ]],
Packit 8f70b4
             [[]])],
Packit 8f70b4
          [gt_cv_inttypes_pri_broken=no],
Packit 8f70b4
          [gt_cv_inttypes_pri_broken=yes])
Packit 8f70b4
      ])
Packit 8f70b4
  fi
Packit 8f70b4
  if test "$gt_cv_inttypes_pri_broken" = yes; then
Packit 8f70b4
    AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
Packit 8f70b4
      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
Packit 8f70b4
    PRI_MACROS_BROKEN=1
Packit 8f70b4
  else
Packit 8f70b4
    PRI_MACROS_BROKEN=0
Packit 8f70b4
  fi
Packit 8f70b4
  AC_SUBST([PRI_MACROS_BROKEN])
Packit 8f70b4
])