apply fix from SVN changset https://trac.osgeo.org/grass/changeset/68912
parent
eac73873aa
commit
bb6e881699
|
@ -38,7 +38,11 @@
|
|||
#define _MM_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
// GCC with C++98 and -fexceptions requires exception
|
||||
// specifiers, however with C++11 and newer, using them causes an error.
|
||||
#if __cplusplus < 201103L
|
||||
#define GRASS_MM_USE_EXCEPTION_SPECIFIER
|
||||
#endif /* __cplusplus < 201103L */
|
||||
|
||||
#define MM_REGISTER_VERSION 2
|
||||
|
||||
|
@ -128,10 +132,17 @@ public:
|
|||
void print();
|
||||
|
||||
friend class mm_register_init;
|
||||
friend void * operator new(size_t) throw(std::bad_alloc);
|
||||
friend void * operator new[](size_t) throw(std::bad_alloc);
|
||||
#ifdef GRASS_MM_USE_EXCEPTION_SPECIFIER
|
||||
friend void * operator new(size_t) throw (std::bad_alloc);
|
||||
friend void * operator new[] (size_t) throw (std::bad_alloc);
|
||||
friend void operator delete(void *) throw();
|
||||
friend void operator delete[](void *) throw();
|
||||
#else
|
||||
friend void * operator new(size_t);
|
||||
friend void * operator new[] (size_t);
|
||||
friend void operator delete(void *) noexcept;
|
||||
friend void operator delete[](void *) noexcept;
|
||||
#endif /* GRASS_MM_USE_EXCEPTION_SPECIFIER */
|
||||
};
|
||||
|
||||
|
||||
|
@ -160,4 +171,4 @@ extern MM_register MM_manager;
|
|||
|
||||
|
||||
|
||||
#endif // _MM_H
|
||||
#endif // _MM_H
|
|
@ -276,7 +276,11 @@ MM_err MM_register::register_deallocation(size_t sz) {
|
|||
|
||||
|
||||
/* ************************************************************ */
|
||||
void* operator new[] (size_t sz) throw(std::bad_alloc) {
|
||||
#ifdef GRASS_MM_USE_EXCEPTION_SPECIFIER
|
||||
void* operator new[] (size_t sz) throw (std::bad_alloc) {
|
||||
#else
|
||||
void* operator new[] (size_t sz) {
|
||||
#endif /* GRASS_MM_USE_EXCEPTION_SPECIFIER */
|
||||
void *p;
|
||||
|
||||
MM_DEBUG cout << "new: sz=" << sz << ", register "
|
||||
|
@ -327,7 +331,11 @@ void* operator new[] (size_t sz) throw(std::bad_alloc) {
|
|||
|
||||
|
||||
/* ************************************************************ */
|
||||
void* operator new (size_t sz) throw(std::bad_alloc) {
|
||||
#ifdef GRASS_MM_USE_EXCEPTION_SPECIFIER
|
||||
void* operator new[] (size_t sz) throw (std::bad_alloc) {
|
||||
#else
|
||||
void* operator new[] (size_t sz) {
|
||||
#endif /* GRASS_MM_USE_EXCEPTION_SPECIFIER */
|
||||
void *p;
|
||||
|
||||
MM_DEBUG cout << "new: sz=" << sz << ", register "
|
||||
|
@ -379,7 +387,11 @@ void* operator new (size_t sz) throw(std::bad_alloc) {
|
|||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
#ifdef GRASS_MM_USE_EXCEPTION_SPECIFIER
|
||||
void operator delete (void *ptr) throw() {
|
||||
#else
|
||||
void operator delete (void *ptr) noexcept {
|
||||
#endif /* GRASS_MM_USE_EXCEPTION_SPECIFIER */
|
||||
size_t sz;
|
||||
void *p;
|
||||
|
||||
|
@ -419,7 +431,11 @@ void operator delete (void *ptr) throw() {
|
|||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
#ifdef GRASS_MM_USE_EXCEPTION_SPECIFIER
|
||||
void operator delete[] (void *ptr) throw() {
|
||||
#else
|
||||
void operator delete (void *ptr) noexcept {
|
||||
#endif /* GRASS_MM_USE_EXCEPTION_SPECIFIER */
|
||||
size_t sz;
|
||||
void *p;
|
||||
|
||||
|
|
Loading…
Reference in New Issue