197 |
# Be sure to use this array to avoid `unused' warnings, which are even |
# Be sure to use this array to avoid `unused' warnings, which are even |
198 |
# errors with `-W error'. |
# errors with `-W error'. |
199 |
m4_define([AC_LANG_BOOL_COMPILE_TRY(C)], |
m4_define([AC_LANG_BOOL_COMPILE_TRY(C)], |
200 |
[AC_LANG_PROGRAM([$1], [int _array_ @<:@1 - 2 * !($2)@:>@; |
[AC_LANG_PROGRAM([$1], [static int test_array @<:@1 - 2 * !($2)@:>@; |
201 |
_array_ @<:@0@:>@ = 0 |
test_array @<:@0@:>@ = 0 |
202 |
])]) |
])]) |
203 |
|
|
204 |
|
|
828 |
# AC_C_LONG_DOUBLE |
# AC_C_LONG_DOUBLE |
829 |
# ---------------- |
# ---------------- |
830 |
AC_DEFUN([AC_C_LONG_DOUBLE], |
AC_DEFUN([AC_C_LONG_DOUBLE], |
831 |
[AC_CACHE_CHECK(for long double, ac_cv_c_long_double, |
[AC_CACHE_CHECK( |
832 |
[if test "$GCC" = yes; then |
[for working long double with more range or precision than double], |
833 |
ac_cv_c_long_double=yes |
[ac_cv_c_long_double], |
834 |
else |
[AC_COMPILE_IFELSE( |
835 |
AC_TRY_RUN( |
[AC_LANG_BOOL_COMPILE_TRY( |
836 |
[int |
[#include <float.h> |
837 |
main () |
long double foo = 0.0;], |
838 |
{ |
[/* Using '|' rather than '||' catches a GCC 2.95.2 x86 bug. */ |
839 |
/* The Stardent Vistra knows sizeof(long double), but does not |
(DBL_MAX < LDBL_MAX) | (LDBL_EPSILON < DBL_EPSILON) |
840 |
support it. */ |
| (DBL_MAX_EXP < LDBL_MAX_EXP) | (DBL_MANT_DIG < LDBL_MANT_DIG)])], |
841 |
long double foo = 0.0; |
ac_cv_c_long_double=yes, |
842 |
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ |
ac_cv_c_long_double=no)]) |
|
exit (sizeof (long double) < sizeof (double)); |
|
|
}], |
|
|
ac_cv_c_long_double=yes, ac_cv_c_long_double=no) |
|
|
fi]) |
|
843 |
if test $ac_cv_c_long_double = yes; then |
if test $ac_cv_c_long_double = yes; then |
844 |
AC_DEFINE(HAVE_LONG_DOUBLE, 1, |
AC_DEFINE(HAVE_LONG_DOUBLE, 1, |
845 |
[Define to 1 if the `long double' type works.]) |
[Define to 1 if long double works and has more range or precision than double.]) |
846 |
fi |
fi |
847 |
])# AC_C_LONG_DOUBLE |
])# AC_C_LONG_DOUBLE |
848 |
|
|