Mercurial > hg > octave-terminal
changeset 13737:30414ff19d5e
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.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Thu, 20 Oct 2011 15:35:44 +0100 |
parents | deb69dab4514 |
children | 7ee61e56eaed |
files | build-aux/bootstrap.conf liboctave/lo-cieee.c liboctave/lo-mappers.cc liboctave/lo-mappers.h |
diffstat | 4 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/build-aux/bootstrap.conf +++ b/build-aux/bootstrap.conf @@ -20,6 +20,7 @@ gnulib_modules=" c-strcase copysign + copysignf closedir crypto/md5 fclose
--- a/liboctave/lo-cieee.c +++ b/liboctave/lo-cieee.c @@ -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)
--- a/liboctave/lo-mappers.cc +++ b/liboctave/lo-mappers.cc @@ -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);
--- a/liboctave/lo-mappers.h +++ b/liboctave/lo-mappers.h @@ -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); }