diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-09-03 06:00:50 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-09-03 06:00:50 +0000 |
commit | 3d0384254969464c3e666d5c6cecd1907ee94661 (patch) | |
tree | 21b444048d4bb98a8f33716f38718f7120c913b0 | |
parent | e36840962a92049b9548938e9233eb3cdfbd540d (diff) | |
download | monitoring-plugins-3d0384254969464c3e666d5c6cecd1907ee94661.tar.gz |
include math.h if needed for HUGE_VAL
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@710 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | configure.in | 14 | ||||
-rw-r--r-- | plugins/common.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/configure.in b/configure.in index c9c92d75..1d36d35d 100644 --- a/configure.in +++ b/configure.in | |||
@@ -463,6 +463,20 @@ AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h regex.h sys/ | |||
463 | AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h) | 463 | AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h) |
464 | AC_CHECK_HEADERS(limits.h sys/param.h sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h fcntl.h sys/statfs.h sys/dustat.h sys/statvfs.h) | 464 | AC_CHECK_HEADERS(limits.h sys/param.h sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h fcntl.h sys/statfs.h sys/dustat.h sys/statvfs.h) |
465 | 465 | ||
466 | # glibc 2.3.2 stdlib.h does not define HUGE_VAL (see man strtod) | ||
467 | AC_MSG_CHECKING([for HUGE_VAL in <stdlib.h>]) | ||
468 | AC_TRY_COMPILE([#include <stdlib.h>], | ||
469 | [double x = HUGE_VAL;], | ||
470 | [AC_MSG_RESULT(yes)], | ||
471 | [AC_MSG_RESULT(no) | ||
472 | AC_MSG_CHECKING([for HUGE_VAL in <math.h>]) | ||
473 | AC_TRY_COMPILE([#include <math.h>], | ||
474 | [double x = HUGE_VAL;], | ||
475 | [AC_MSG_RESULT(yes) | ||
476 | AC_DEFINE_UNQUOTED(HUGE_VAL_NEEDS_MATH_H, 1, | ||
477 | [Define if <math.h> is required for HUGE_VAL])], | ||
478 | [AC_MSG_RESULT(no)])]) | ||
479 | |||
466 | # Define HAVE_INTTYPES_H if <inttypes.h> exists, | 480 | # Define HAVE_INTTYPES_H if <inttypes.h> exists, |
467 | # doesn't clash with <sys/types.h>, and declares uintmax_t. | 481 | # doesn't clash with <sys/types.h>, and declares uintmax_t. |
468 | 482 | ||
diff --git a/plugins/common.h b/plugins/common.h index e55b0bbd..372e59ac 100644 --- a/plugins/common.h +++ b/plugins/common.h | |||
@@ -40,6 +40,10 @@ | |||
40 | #include <stdlib.h> | 40 | #include <stdlib.h> |
41 | #include <errno.h> | 41 | #include <errno.h> |
42 | 42 | ||
43 | #ifdef HUGE_VAL_NEEDS_MATH_H | ||
44 | #include <math.h> | ||
45 | #endif | ||
46 | |||
43 | #ifdef HAVE_STRINGS_H | 47 | #ifdef HAVE_STRINGS_H |
44 | #include <strings.h> | 48 | #include <strings.h> |
45 | #endif | 49 | #endif |