summaryrefslogtreecommitdiffstats
path: root/gl/m4/limits-h.m4
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-11-17 01:05:54 +0100
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2022-07-24 19:35:11 +0200
commita405fc138596f552581d2011fd6de02d5c8186c4 (patch)
tree4c084700b5cb5e9fcedf982a2d921bbc41d9935a /gl/m4/limits-h.m4
parent9f2a9ca3d72023ff9b5707d1872c54d65edc9017 (diff)
downloadmonitoring-plugins-a405fc1.tar.gz
Sync with the latest Gnulib code (1a268176f)
Diffstat (limited to 'gl/m4/limits-h.m4')
-rw-r--r--gl/m4/limits-h.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
new file mode 100644
index 00000000..00c9fe9e
--- /dev/null
+++ b/gl/m4/limits-h.m4
@@ -0,0 +1,44 @@
1dnl Check whether limits.h has needed features.
2
3dnl Copyright 2016-2021 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl From Paul Eggert.
9
10AC_DEFUN_ONCE([gl_LIMITS_H],
11[
12 gl_CHECK_NEXT_HEADERS([limits.h])
13
14 AC_CACHE_CHECK([whether limits.h has WORD_BIT, BOOL_WIDTH etc.],
15 [gl_cv_header_limits_width],
16 [AC_COMPILE_IFELSE(
17 [AC_LANG_PROGRAM(
18 [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
19 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
20 #endif
21 #include <limits.h>
22 long long llm = LLONG_MAX;
23 int wb = WORD_BIT;
24 int ullw = ULLONG_WIDTH;
25 int bw = BOOL_WIDTH;
26 ]])],
27 [gl_cv_header_limits_width=yes],
28 [gl_cv_header_limits_width=no])])
29 if test "$gl_cv_header_limits_width" = yes; then
30 LIMITS_H=
31 else
32 LIMITS_H=limits.h
33 fi
34 AC_SUBST([LIMITS_H])
35 AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
36])
37
38dnl Unconditionally enables the replacement of <limits.h>.
39AC_DEFUN([gl_REPLACE_LIMITS_H],
40[
41 AC_REQUIRE([gl_LIMITS_H])
42 LIMITS_H='limits.h'
43 AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
44])