stdint_h.m4 929 Bytes
Newer Older
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
1 2
# stdint_h.m4 serial 8
dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
3 4 5
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
6 7 8 9 10 11

dnl From Paul Eggert.

# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
# doesn't clash with <sys/types.h>, and declares uintmax_t.

12
AC_DEFUN([gl_AC_HEADER_STDINT_H],
13
[
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
14
  AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
15 16 17
  [AC_TRY_COMPILE(
    [#include <sys/types.h>
#include <stdint.h>],
18
    [uintmax_t i = (uintmax_t) -1; return !i;],
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
19 20
    [gl_cv_header_stdint_h=yes],
    [gl_cv_header_stdint_h=no])])
21
  if test $gl_cv_header_stdint_h = yes; then
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
22
    AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
23 24
      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
       and declares uintmax_t. ])
25 26
  fi
])