X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Fexponentl.m4;h=136fa61e344d411af2e1a02057ff131ea60ec943;hb=81c12defcf36bb9696339dc9a596aba6f0f0c11d;hp=a700d3ba60fd7657520f809e10e9dec44541f05c;hpb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;p=debian%2Fgzip diff --git a/m4/exponentl.m4 b/m4/exponentl.m4 index a700d3b..136fa61 100644 --- a/m4/exponentl.m4 +++ b/m4/exponentl.m4 @@ -1,15 +1,17 @@ -# exponentl.m4 serial 2 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# exponentl.m4 serial 4 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION], [ AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([where to find the exponent in a 'long double'], [gl_cv_cc_long_double_expbit0], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -74,13 +76,28 @@ int main () fprintf (fp, "unknown"); return (fclose (fp) != 0); } - ], + ]])], [gl_cv_cc_long_double_expbit0=`cat conftest.out`], [gl_cv_cc_long_double_expbit0="unknown"], [ - dnl When cross-compiling, we don't know. It depends on the + dnl When cross-compiling, in general we don't know. It depends on the dnl ABI and compiler version. There are too many cases. gl_cv_cc_long_double_expbit0="unknown" + case "$host_os" in + mingw*) # On native Windows (little-endian), we know the result + # in two cases: mingw, MSVC. + AC_EGREP_CPP([Known], [ +#ifdef __MINGW32__ + Known +#endif + ], [gl_cv_cc_long_double_expbit0="word 2 bit 0"]) + AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], [gl_cv_cc_long_double_expbit0="word 1 bit 20"]) + ;; + esac ]) rm -f conftest.out ])