maint: update copyright
[gnulib.git] / m4 / floorf.m4
index 83bfc78..cc0221b 100644 (file)
@@ -1,5 +1,5 @@
-# floorf.m4 serial 11
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# floorf.m4 serial 13
+dnl Copyright (C) 2007, 2009-2014 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.
@@ -22,6 +22,7 @@ AC_DEFUN([gl_FUNC_FLOORF],
     fi
     m4_ifdef([gl_FUNC_FLOORF_IEEE], [
       if test $gl_floorf_required = ieee && test $REPLACE_FLOORF = 0; then
+        AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
         AC_CACHE_CHECK([whether floorf works according to ISO C 99 with IEC 60559],
           [gl_cv_func_floorf_ieee],
           [
@@ -47,7 +48,13 @@ int main (int argc, char *argv[])
               ]])],
               [gl_cv_func_floorf_ieee=yes],
               [gl_cv_func_floorf_ieee=no],
-              [gl_cv_func_floorf_ieee="guessing no"])
+              [case "$host_os" in
+                         # Guess yes on glibc systems.
+                 *-gnu*) gl_cv_func_floorf_ieee="guessing yes" ;;
+                         # If we don't know, assume the worst.
+                 *)      gl_cv_func_floorf_ieee="guessing no" ;;
+               esac
+              ])
             LIBS="$save_LIBS"
           ])
         case "$gl_cv_func_floorf_ieee" in
@@ -78,8 +85,9 @@ AC_DEFUN([gl_FUNC_FLOORF_LIBS],
            # define __NO_MATH_INLINES 1 /* for glibc */
            #endif
            #include <math.h>
+           float (*funcptr) (float) = floorf;
            float x;]],
-         [[x = floorf(x);]])],
+         [[x = funcptr(x) + floorf(x);]])],
       [gl_cv_func_floorf_libm=])
     if test "$gl_cv_func_floorf_libm" = "?"; then
       save_LIBS="$LIBS"
@@ -90,8 +98,9 @@ AC_DEFUN([gl_FUNC_FLOORF_LIBS],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
+             float (*funcptr) (float) = floorf;
              float x;]],
-           [[x = floorf(x);]])],
+           [[x = funcptr(x) + floorf(x);]])],
         [gl_cv_func_floorf_libm="-lm"])
       LIBS="$save_LIBS"
     fi