diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2021-11-17 01:05:54 +0100 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-07-24 19:35:11 +0200 |
commit | a405fc138596f552581d2011fd6de02d5c8186c4 (patch) | |
tree | 4c084700b5cb5e9fcedf982a2d921bbc41d9935a /gl/m4/minmax.m4 | |
parent | 9f2a9ca3d72023ff9b5707d1872c54d65edc9017 (diff) | |
download | monitoring-plugins-a405fc1.tar.gz |
Sync with the latest Gnulib code (1a268176f)
Diffstat (limited to 'gl/m4/minmax.m4')
-rw-r--r-- | gl/m4/minmax.m4 | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4 new file mode 100644 index 00000000..e21a6879 --- /dev/null +++ b/gl/m4/minmax.m4 | |||
@@ -0,0 +1,44 @@ | |||
1 | # minmax.m4 serial 4 | ||
2 | dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc. | ||
3 | dnl This file is free software; the Free Software Foundation | ||
4 | dnl gives unlimited permission to copy and/or distribute it, | ||
5 | dnl with or without modifications, as long as this notice is preserved. | ||
6 | |||
7 | AC_PREREQ([2.53]) | ||
8 | |||
9 | AC_DEFUN([gl_MINMAX], | ||
10 | [ | ||
11 | AC_REQUIRE([gl_PREREQ_MINMAX]) | ||
12 | ]) | ||
13 | |||
14 | # Prerequisites of lib/minmax.h. | ||
15 | AC_DEFUN([gl_PREREQ_MINMAX], | ||
16 | [ | ||
17 | gl_MINMAX_IN_HEADER([limits.h]) | ||
18 | gl_MINMAX_IN_HEADER([sys/param.h]) | ||
19 | ]) | ||
20 | |||
21 | dnl gl_MINMAX_IN_HEADER(HEADER) | ||
22 | dnl The parameter has to be a literal header name; it cannot be macro, | ||
23 | dnl nor a shell variable. (Because autoheader collects only AC_DEFINE | ||
24 | dnl invocations with a literal macro name.) | ||
25 | AC_DEFUN([gl_MINMAX_IN_HEADER], | ||
26 | [ | ||
27 | m4_pushdef([header], AS_TR_SH([$1])) | ||
28 | m4_pushdef([HEADER], AS_TR_CPP([$1])) | ||
29 | AC_CACHE_CHECK([whether <$1> defines MIN and MAX], | ||
30 | [gl_cv_minmax_in_]header, | ||
31 | [AC_COMPILE_IFELSE( | ||
32 | [AC_LANG_PROGRAM( | ||
33 | [[#include <$1> | ||
34 | int x = MIN (42, 17);]], | ||
35 | [[]])], | ||
36 | [gl_cv_minmax_in_]header[=yes], | ||
37 | [gl_cv_minmax_in_]header[=no])]) | ||
38 | if test $gl_cv_minmax_in_[]header = yes; then | ||
39 | AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1, | ||
40 | [Define to 1 if <$1> defines the MIN and MAX macros.]) | ||
41 | fi | ||
42 | m4_popdef([HEADER]) | ||
43 | m4_popdef([header]) | ||
44 | ]) | ||