blob: fd94c11c86e06fa97e066e3d8287edd629018d55 [file] [log] [blame]
Reid Spencerb2ed05262006-11-03 18:04:08 +00001#
2# This function determins if the the HUGE_VAL macro is compilable with the
3# -pedantic switch or not. XCode < 2.4.1 doesn't get it right.
4#
5AC_DEFUN([AC_HUGE_VAL_CHECK],[
6 AC_CACHE_CHECK([for HUGE_VAL sanity], [ac_cv_huge_val_sanity],[
Reid Spencer6a7c0b72006-11-03 19:49:16 +00007 AC_LANG_PUSH([C++])
8 CXXFLAGS=-pedantic
Reid Spencerb2ed05262006-11-03 18:04:08 +00009 AC_RUN_IFELSE(
10 AC_LANG_PROGRAM(
11 [#include <math.h>],
12 [double x = HUGE_VAL; return x != x; ]),
13 [ac_cv_huge_val_sanity=yes],[ac_cv_huge_val_sanity=no],
14 [ac_cv_huge_val_sanity=yes])
Reid Spencer6a7c0b72006-11-03 19:49:16 +000015 AC_LANG_POP([C++])
Reid Spencerb2ed05262006-11-03 18:04:08 +000016 ])
17 AC_SUBST(HUGE_VAL_SANITY,$ac_cv_huge_val_sanity)
18])