# HG changeset patch # User Michael Goffioul # Date 1319121344 -3600 # Node ID 30414ff19d5e5b52eb1b0b2ffc051a5b31d639cc # Parent deb69dab45148c9e3ee9a6644ba72b9b2019ecd0 Use copysignf module from gnulib. * bootstrap.conf: Add copysignf. * lo-cieee.c: Remove obsolete CPP statements about copysign. * lo-mappers.h (xcopysign): Make non inlined. (xcopysignf): Likewise. * lo-mappers.cc (xcopysign): Moved from header and use gnulib replavement. (xcopysignf): Likewise. diff -r deb69dab4514 -r 30414ff19d5e build-aux/bootstrap.conf --- a/build-aux/bootstrap.conf Thu Oct 20 15:19:38 2011 +0100 +++ b/build-aux/bootstrap.conf Thu Oct 20 15:35:44 2011 +0100 @@ -20,6 +20,7 @@ gnulib_modules=" c-strcase copysign + copysignf closedir crypto/md5 fclose diff -r deb69dab4514 -r 30414ff19d5e liboctave/lo-cieee.c --- a/liboctave/lo-cieee.c Thu Oct 20 15:19:38 2011 +0100 +++ b/liboctave/lo-cieee.c Thu Oct 20 15:35:44 2011 +0100 @@ -47,11 +47,6 @@ #define HAVE_FINITE 1 #endif -#if ! defined (HAVE_COPYSIGN) && defined (HAVE__COPYSIGN) -#define copysign _copysign -#define HAVE_COPYSIGN 1 -#endif - #if defined (_AIX) && defined (__GNUG__) #undef finite #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX) diff -r deb69dab4514 -r 30414ff19d5e liboctave/lo-mappers.cc --- a/liboctave/lo-mappers.cc Thu Oct 20 15:19:38 2011 +0100 +++ b/liboctave/lo-mappers.cc Thu Oct 20 15:35:44 2011 +0100 @@ -48,6 +48,12 @@ return gnulib::trunc (x); } +double +xcopysign (double x, double y) +{ + return gnulib::copysign (x, y); +} + double xfloor (double x) { return gnulib::floor (x); @@ -268,6 +274,12 @@ } float +xcopysign (float x, float y) +{ + return gnulib::copysignf (x, y); +} + +float xround (float x) { return gnulib::round (x); diff -r deb69dab4514 -r 30414ff19d5e liboctave/lo-mappers.h --- a/liboctave/lo-mappers.h Thu Oct 20 15:19:38 2011 +0100 +++ b/liboctave/lo-mappers.h Thu Oct 20 15:35:44 2011 +0100 @@ -31,7 +31,7 @@ // Double Precision extern OCTAVE_API double xtrunc (double x); -inline double xcopysign (double x, double y) { return copysign (x, y); } +extern OCTAVE_API double xcopysign (double x, double y); inline double xceil (double x) { return ceil (x); } extern OCTAVE_API double xfloor (double x); inline double arg (double x) { return atan2 (0.0, x); } @@ -117,7 +117,7 @@ // Single Precision extern OCTAVE_API float xtrunc (float x); -inline float xcopysign (float x, float y) { return copysignf (x, y); } +extern OCTAVE_API float xcopysign (float x, float y); inline float xceil (float x) { return ceilf (x); } inline float xfloor (float x) { return floorf (x); } inline float arg (float x) { return atan2f (0.0f, x); }