Handle the case that floorl and roundl are declared but do not exist.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Nov 2007 13:08:25 +0000 (14:08 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Nov 2007 13:08:25 +0000 (14:08 +0100)
ChangeLog
lib/round.c
m4/roundf.m4
m4/roundl.m4

index 2f8a5fa88ce5e5ec7a7545a1c5fcc5c33473ae5d..3bdb99ed3b7ce7676619b66174ee5435a9e9ceac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-11-11  Bruno Haible  <bruno@clisp.org>
+
+       * m4/roundf.m4 (gl_FUNC_ROUNDF): Handle the case that floorf and
+       roundf were declared but do not exist on functions.
+       * m4/roundl.m4 (gl_FUNC_ROUNDL): Handle the case that floorl and
+       roundl were declared but do not exist on functions.
+       * lib/round.c (HAVE_FLOOR_AND_CEIL): Use HAVE_FLOORF_AND_CEILF and
+       HAVE_FLOORL_AND_CEILL, respectively.
+       Needed for Sun C on Solaris 10.
+
 2007-11-11  Bruno Haible  <bruno@clisp.org>
 
        * m4/roundf.m4 (gl_FUNC_ROUNDF): Set REPLACE_ROUNDF instead of
index 5758fb7c79c571d9f9e7c9d137fe2aa1955cf9d9..4f85402df92442aa085b98c475261b4112f63e1e 100644 (file)
@@ -30,7 +30,7 @@
 # define DOUBLE long double
 # define MANT_DIG LDBL_MANT_DIG
 # define L_(literal) literal##L
-# define HAVE_FLOOR_AND_CEIL (HAVE_DECL_FLOORL && HAVE_DECL_CEILL)
+# define HAVE_FLOOR_AND_CEIL HAVE_FLOORL_AND_CEILL
 #elif ! defined USE_FLOAT
 # define ROUND round
 # define FLOOR floor
@@ -46,7 +46,7 @@
 # define DOUBLE float
 # define MANT_DIG FLT_MANT_DIG
 # define L_(literal) literal##f
-# define HAVE_FLOOR_AND_CEIL (HAVE_DECL_FLOORF && HAVE_DECL_CEILF)
+# define HAVE_FLOOR_AND_CEIL HAVE_FLOORF_AND_CEILF
 #endif
 
 /* If we're being included from test-round2[f].c, it already defined names for
index 10dbfea75bc5dd2cd4fa5f4e9cc1722eda89ad28..5878beb735b08f19e38d582a1e824f2b31cd2ec1 100644 (file)
@@ -20,6 +20,12 @@ AC_DEFUN([gl_FUNC_ROUNDF],
     if test "$ac_cv_have_decl_floorf" = yes \
        && test "$ac_cv_have_decl_ceilf" = yes; then
       gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = floorf (x) + ceilf (x);])
+      if test "$ROUNDF_LIBM" != missing; then
+        AC_DEFINE([HAVE_FLOORF_AND_CEILF], 1,
+          [Define if the both the floorf() and ceilf() functions exist.])
+      else
+        ROUNDF_LIBM=
+      fi
     else
       ROUNDF_LIBM=
     fi
index 1779a31bde87f5b753a61f785bb97ef7afb5ca03..a35943ca6233faf431634be9f3a5aae8b15ed7f9 100644 (file)
@@ -20,6 +20,12 @@ AC_DEFUN([gl_FUNC_ROUNDL],
     if test "$ac_cv_have_decl_floorl" = yes \
        && test "$ac_cv_have_decl_ceill" = yes; then
       gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = floorl (x) + ceill (x);])
+      if test "$ROUNDL_LIBM" != missing; then
+        AC_DEFINE([HAVE_FLOORL_AND_CEILL], 1,
+          [Define if the both the floorl() and ceill() functions exist.])
+      else
+        ROUNDL_LIBM=
+      fi
     else
       ROUNDL_LIBM=
     fi