Mercurial > hg > octave-max
changeset 4352:80b83de0aa2a
[project @ 2003-02-21 20:01:38 by jwe]
author | jwe |
---|---|
date | Fri, 21 Feb 2003 20:01:39 +0000 |
parents | 1e7f4405e037 |
children | ea4b8c35ac9d |
files | ChangeLog configure.in liboctave/ChangeLog liboctave/oct-alloc.h src/ChangeLog src/oct-obj.h |
diffstat | 6 files changed, 34 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-02-21 John W. Eaton <jwe@bevo.che.wisc.edu> + * configure.in (AH_BOTTOM): Define HAVE_PLACEMENT_DELETE for gcc + 3.2 and later. + * configure.in: Check for copysign and signbit. 2003-02-18 John W. Eaton <jwe@bevo.che.wisc.edu>
--- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ ### 02111-1307, USA. AC_INIT -AC_REVISION($Revision: 1.414 $) +AC_REVISION($Revision: 1.415 $) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1388,6 +1388,10 @@ #if defined (__DECCXX) #define __USE_STD_IOSTREAM #endif + +#if defined (__GNUG__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 2 +#define HAVE_PLACEMENT_DELETE 1 +#endif ]) ### Do the substitutions in all the Makefiles.
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,8 @@ 2003-02-21 John W. Eaton <jwe@bevo.che.wisc.edu> + * oct-alloc.h (DECLARE_OCTAVE_ALLOCATOR): Handle systems with or + without placement delete. + * CMatrix.cc (ComplexMatrix::all_elements_are_real): Don't lose -0 imaginary parts.
--- a/liboctave/oct-alloc.h +++ b/liboctave/oct-alloc.h @@ -59,12 +59,21 @@ bool grow (void); }; +#if defined (HAVE_PLACEMENT_DELETE) +#define DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \ + void operator delete (void *p, void *) \ + { ::operator delete (p, static_cast<void*> (0)); } +#else +#define DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \ + void operator delete (void *p, void *) \ + { ::operator delete (p); } +#endif + #define DECLARE_OCTAVE_ALLOCATOR \ public: \ void *operator new (size_t size, void *p) \ { return ::operator new (size, p); } \ - void operator delete (void *p, void *) \ - { ::operator delete (p); } \ + DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \ void *operator new (size_t size) { return allocator.alloc (size); } \ void operator delete (void *p, size_t size) { allocator.free (p, size); } \ private: \
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-02-21 John W. Eaton <jwe@bevo.che.wisc.edu> + + * oct-obj.h (octave_value_list::operator delete): Handle systems + with or without placement delete. + 2003-02-21 Paul Kienzle <pkienzle@users.sf.net> * utils.cc (octave_vsnprintf): Return value of vsnprintf is int,
--- a/src/oct-obj.h +++ b/src/oct-obj.h @@ -66,7 +66,13 @@ { return ::operator new (size, p); } void operator delete (void *p, void *) - { ::operator delete (p, static_cast<void *> (0)); } + { +#if defined (HAVE_PLACEMENT_DELETE) + ::operator delete (p, static_cast<void *> (0)); +#else + ::operator delete (p); +#endif + } octave_value_list& operator = (const octave_value_list& obj) {