From 78bc4567f3d810060fd52cc0c7ce5d6d0eade46d Mon Sep 17 00:00:00 2001 From: jgarcia Date: Fri, 13 Oct 2006 20:49:31 +0000 Subject: [PATCH] Several float specializations break the program in Linux/AMD64 --- src/aclocal.m4 | 4 ++-- src/c/num_sfun.d | 2 +- src/h/config.h.in | 2 ++ src/h/internal.h | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index e6308b938..2e5d3fc98 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -194,7 +194,7 @@ case "${host_os}" in BUNDLE_LDFLAGS="-shared ${LDFLAGS}" LDRPATH='-Wl,--rpath,~A' clibs="-ldl" - # Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ??? + CFLAGS="-D_GNU_SOURCE ${CFLAGS}" ;; kfreebsd*-gnu) thehost='kfreebsd' @@ -204,7 +204,7 @@ case "${host_os}" in BUNDLE_LDFLAGS="-shared ${LDFLAGS}" LDRPATH='-Wl,--rpath,/usr/lib/ecl/' clibs="-ldl" - # Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ??? + CFLAGS="-D_GNU_SOURCE ${CFLAGS}" ;; freebsd*) thehost='freebsd' diff --git a/src/c/num_sfun.d b/src/c/num_sfun.d index 0cca944ad..ab845c7e8 100644 --- a/src/c/num_sfun.d +++ b/src/c/num_sfun.d @@ -186,7 +186,7 @@ cl_log1(cl_object x) case t_fixnum: case t_bignum: case t_ratio: - return1(make_singlefloat(logf(number_to_double(x)))); + return1(make_singlefloat(log(number_to_double(x)))); #ifdef ECL_SHORT_FLOAT case t_shortfloat: return1(make_shortfloat(logf(ecl_short_float(x)))); diff --git a/src/h/config.h.in b/src/h/config.h.in index 46005f0c6..94b185efb 100644 --- a/src/h/config.h.in +++ b/src/h/config.h.in @@ -224,6 +224,7 @@ typedef unsigned @CL_FIXNUM_TYPE@ cl_hashkey; /* the tzset() function gets the current time zone */ #undef HAVE_TZSET /* several floating point functions (ISO C99) */ +#if 0 #undef HAVE_EXPF #undef HAVE_LOGF #undef HAVE_SQRTF @@ -233,6 +234,7 @@ typedef unsigned @CL_FIXNUM_TYPE@ cl_hashkey; #undef HAVE_SINHF #undef HAVE_COSHF #undef HAVE_TANHF +#endif #undef HAVE_FLOORF #undef HAVE_CEILF #undef HAVE_FABSF diff --git a/src/h/internal.h b/src/h/internal.h index be4c10475..73a59a527 100644 --- a/src/h/internal.h +++ b/src/h/internal.h @@ -252,6 +252,8 @@ extern cl_object si_get_library_pathname(void); /* * Fake several ISO C99 mathematical functions */ +#define _GNU_SOURCE + #ifndef HAVE_EXPF # define expf(x) exp((float)x) #endif