# HG changeset patch # User Bruno Haible # Date 1330128552 -3600 # Node ID 4576be79e9e746ae4af41af32683d30e89d82f46 # Parent 60e9584368df55c2394910966ccd8930b7a1015e ceilf: Provide function definition on MSVC. * m4/ceilf.m4 (gl_FUNC_CEILF_LIBS): Test also whether ceilf can be used as a function pointer. * lib/math.in.h (ceilf): Undefine if it is not declared as a function. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-24 Bruno Haible + + ceilf: Provide function definition on MSVC. + * m4/ceilf.m4 (gl_FUNC_CEILF_LIBS): Test also whether ceilf can be + used as a function pointer. + * lib/math.in.h (ceilf): Undefine if it is not declared as a function. + 2012-02-24 Bruno Haible floorf: Provide function definition on MSVC. diff --git a/lib/math.in.h b/lib/math.in.h --- a/lib/math.in.h +++ b/lib/math.in.h @@ -262,6 +262,7 @@ _GL_CXXALIAS_RPL (ceilf, float, (float x)); # else # if !@HAVE_DECL_CEILF@ +# undef ceilf _GL_FUNCDECL_SYS (ceilf, float, (float x)); # endif _GL_CXXALIAS_SYS (ceilf, float, (float x)); diff --git a/m4/ceilf.m4 b/m4/ceilf.m4 --- a/m4/ceilf.m4 +++ b/m4/ceilf.m4 @@ -1,4 +1,4 @@ -# ceilf.m4 serial 12 +# ceilf.m4 serial 13 dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -82,8 +82,9 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include + float (*funcptr) (float) = ceilf; float x;]], - [[x = ceilf(x);]])], + [[x = funcptr(x) + ceilf(x);]])], [gl_cv_func_ceilf_libm=]) if test "$gl_cv_func_ceilf_libm" = "?"; then save_LIBS="$LIBS" @@ -94,8 +95,9 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include + float (*funcptr) (float) = ceilf; float x;]], - [[x = ceilf(x);]])], + [[x = funcptr(x) + ceilf(x);]])], [gl_cv_func_ceilf_libm="-lm"]) LIBS="$save_LIBS" fi