|
Packit Service |
4684c1 |
dnl Check whether limits.h has needed features.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
dnl Copyright 2016-2020 Free Software Foundation, Inc.
|
|
Packit Service |
4684c1 |
dnl This file is free software; the Free Software Foundation
|
|
Packit Service |
4684c1 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit Service |
4684c1 |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
dnl From Paul Eggert.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
AC_DEFUN_ONCE([gl_LIMITS_H],
|
|
Packit Service |
4684c1 |
[
|
|
Packit Service |
4684c1 |
gl_CHECK_NEXT_HEADERS([limits.h])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.],
|
|
Packit Service |
4684c1 |
[gl_cv_header_limits_width],
|
|
Packit Service |
4684c1 |
[AC_COMPILE_IFELSE(
|
|
Packit Service |
4684c1 |
[AC_LANG_PROGRAM(
|
|
Packit Service |
4684c1 |
[[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
|
|
Packit Service |
4684c1 |
#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
|
|
Packit Service |
4684c1 |
#endif
|
|
Packit Service |
4684c1 |
#include <limits.h>
|
|
Packit Service |
4684c1 |
long long llm = LLONG_MAX;
|
|
Packit Service |
4684c1 |
int wb = WORD_BIT;
|
|
Packit Service |
4684c1 |
int ullw = ULLONG_WIDTH;
|
|
Packit Service |
4684c1 |
]])],
|
|
Packit Service |
4684c1 |
[gl_cv_header_limits_width=yes],
|
|
Packit Service |
4684c1 |
[gl_cv_header_limits_width=no])])
|
|
Packit Service |
4684c1 |
if test "$gl_cv_header_limits_width" = yes; then
|
|
Packit Service |
4684c1 |
LIMITS_H=
|
|
Packit Service |
4684c1 |
else
|
|
Packit Service |
4684c1 |
LIMITS_H=limits.h
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
AC_SUBST([LIMITS_H])
|
|
Packit Service |
4684c1 |
AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
|
|
Packit Service |
4684c1 |
])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
dnl Unconditionally enables the replacement of <limits.h>.
|
|
Packit Service |
4684c1 |
AC_DEFUN([gl_REPLACE_LIMITS_H],
|
|
Packit Service |
4684c1 |
[
|
|
Packit Service |
4684c1 |
AC_REQUIRE([gl_LIMITS_H])
|
|
Packit Service |
4684c1 |
LIMITS_H='limits.h'
|
|
Packit Service |
4684c1 |
AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
|
|
Packit Service |
4684c1 |
])
|