Mercurial > hg > octave-thorsten
changeset 5098:ab4e64f92526
[project @ 2004-12-18 15:04:20 by jwe]
author | jwe |
---|---|
date | Sat, 18 Dec 2004 15:04:20 +0000 |
parents | 69b822a4129c |
children | f7e39f977fe8 |
files | ChangeLog configure.in liboctave/ChangeLog liboctave/lo-cieee.c liboctave/lo-ieee.h |
diffstat | 5 files changed, 44 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-17 John W. Eaton <jwe@octave.org> + + * configure.in: Use AC_GNU_SOURCE. + +2004-12-17 Orion Poplawski <orion@cora.nwra.com> + + * configure.in: Also check for signbit decl. + 2004-12-03 John W. Eaton <jwe@octave.org> * aclocal.m4 (OCTAVE_PROG_GPERF): Check with -L C++, not -L ANSI_C.
--- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.458 $) +AC_REVISION($Revision: 1.459 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -38,6 +38,8 @@ OCTAVE_HOST_TYPE +AC_GNU_SOURCE + AC_AIX AC_MINIX AC_ISC_POSIX @@ -1153,6 +1155,7 @@ ;; *) AC_CHECK_FUNCS(finite isnan isinf copysign signbit) + AC_CHECK_DECLS(signbit, , , [#include <math.h>]) ;; esac
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +2004-12-17 John W. Eaton <jwe@octave.org> + + * lo-cieee.c (lo_ieee_signbit): New function. + * lo-ieee.h: Provide decl. + Don't define lo_ieee_signbit as a macro here. + From Orion Poplawski <orion@cora.nwra.com>. + 2004-11-18 John W. Eaton <jwe@octave.org> * int32NDArray.cc (pow): Delete instantiation.
--- a/liboctave/lo-cieee.c +++ b/liboctave/lo-cieee.c @@ -153,6 +153,30 @@ return octave_NaN; } +#if ! (defined (signbit) || defined (HAVE_DECL_SIGNBIT)) && defined (HAVE_SIGNBIT) +extern int signbit (double); +#endif + +int +lo_ieee_signbit (double x) +{ +/* In the following definitions, only check x < 0 explicitly to avoid + a function call when it looks like signbit or copysign are actually + functions. */ + +#if defined (signbit) + return signbit (x); +#elif defined (HAVE_SIGNBIT) + return (x < 0 || signbit (x)); +#elif defined (copysign) + return (copysign (1.0, x) < 0); +#elif defined (HAVE_COPYSIGN) + return (x < 0 || copysign (1.0, x) < 0); +#else + return x < 0; +#endif +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/liboctave/lo-ieee.h +++ b/liboctave/lo-ieee.h @@ -66,24 +66,7 @@ extern double lo_ieee_na_value (void); extern double lo_ieee_nan_value (void); -/* In the following definitions, only check x < 0 explicitly to avoid - a function call when it looks like signbit or copysign are actually - functions. */ - -#if defined (signbit) -#define lo_ieee_signbit(x) signbit (x) -#elif defined (HAVE_SIGNBIT) -#if defined (__MINGW32__) -extern int signbit (double); -#endif -#define lo_ieee_signbit(x) (x < 0 || signbit (x)) -#elif defined (copysign) -#define lo_ieee_signbit(x) (copysign (1.0, x) < 0) -#elif defined (HAVE_COPYSIGN) -#define lo_ieee_signbit(x) (x < 0 || copysign (1.0, x) < 0) -#else -#define lo_ieee_signbit(x) 0 -#endif +extern int lo_ieee_signbit (double); #ifdef __cplusplus }