xref: /openbsd-src/gnu/gcc/config/stdint_h.m4 (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert# stdint_h.m4 serial 3 (gettext-0.12)
2*404b540aSrobertdnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3*404b540aSrobertdnl This file is free software, distributed under the terms of the GNU
4*404b540aSrobertdnl General Public License.  As a special exception to the GNU General
5*404b540aSrobertdnl Public License, this file may be distributed as part of a program
6*404b540aSrobertdnl that contains a configuration script generated by Autoconf, under
7*404b540aSrobertdnl the same distribution terms as the rest of that program.
8*404b540aSrobert
9*404b540aSrobertdnl From Paul Eggert.
10*404b540aSrobert
11*404b540aSrobert# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
12*404b540aSrobert# doesn't clash with <sys/types.h>, and declares uintmax_t.
13*404b540aSrobert
14*404b540aSrobertAC_DEFUN([jm_AC_HEADER_STDINT_H],
15*404b540aSrobert[
16*404b540aSrobert  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
17*404b540aSrobert  [AC_TRY_COMPILE(
18*404b540aSrobert    [#include <sys/types.h>
19*404b540aSrobert#include <stdint.h>],
20*404b540aSrobert    [uintmax_t i = (uintmax_t) -1;],
21*404b540aSrobert    jm_ac_cv_header_stdint_h=yes,
22*404b540aSrobert    jm_ac_cv_header_stdint_h=no)])
23*404b540aSrobert  if test $jm_ac_cv_header_stdint_h = yes; then
24*404b540aSrobert    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
25*404b540aSrobert      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
26*404b540aSrobert       and declares uintmax_t. ])
27*404b540aSrobert  fi
28*404b540aSrobert])
29