From a2575c3c96be502e4af420f50e6b816569330531 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 22 Nov 2015 17:09:05 +0300
Subject: [PATCH 27/27] The operator new declaration has changed slightly in
 C++11.

It has to do with the fact that the throwing exception specification is deprecated in C++11,
and the introduction of the nothrow declaration:
throw (std::bad_alloc) has been omitted
throw() is replaced with nothrow
---
 src/common/classes/alloc.cpp | 10 +++++-----
 src/common/classes/alloc.h   | 24 ++++++++++++------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp
index 257030bccb..d6036ec2b2 100644
--- a/src/common/classes/alloc.cpp
+++ b/src/common/classes/alloc.cpp
@@ -2182,7 +2182,7 @@
 }
 
 #ifdef LIBC_CALLS_NEW
-void* MemoryPool::globalAlloc(size_t s) THROW_BAD_ALLOC
+void* MemoryPool::globalAlloc(size_t s)
 {
 	if (!processMemoryPool)
 	{
@@ -2229,20 +2229,20 @@
 
 } // namespace Firebird
 
-void* operator new(size_t s) THROW_BAD_ALLOC
+void* operator new(size_t s)
 {
 	return Firebird::MemoryPool::globalAlloc(s ALLOC_ARGS);
 }
-void* operator new[](size_t s) THROW_BAD_ALLOC
+void* operator new[](size_t s)
 {
 	return Firebird::MemoryPool::globalAlloc(s ALLOC_ARGS);
 }
 
-void operator delete(void* mem) throw()
+void operator delete(void* mem) noexcept
 {
 	Firebird::MemoryPool::globalFree(mem);
 }
-void operator delete[](void* mem) throw()
+void operator delete[](void* mem) noexcept
 {
 	Firebird::MemoryPool::globalFree(mem);
 }
diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h
index 93ffe370cc..0c7e38f24d 100644
--- a/src/common/classes/alloc.h
+++ b/src/common/classes/alloc.h
@@ -405,9 +405,9 @@
 	// This method is needed when C++ runtime can call
 	// redefined by us operator new before initialization of global variables.
 #ifdef LIBC_CALLS_NEW
-	static void* globalAlloc(size_t s ALLOC_PARAMS) THROW_BAD_ALLOC;
+	static void* globalAlloc(size_t s ALLOC_PARAMS);
 #else // LIBC_CALLS_NEW
-	static void* globalAlloc(size_t s ALLOC_PARAMS) THROW_BAD_ALLOC
+	static void* globalAlloc(size_t s ALLOC_PARAMS)
 	{
 		return processMemoryPool->allocate(s ALLOC_PASS_ARGS);
 	}
@@ -494,46 +494,46 @@
 
 // operators new and delete
 
-void* operator new(size_t s) THROW_BAD_ALLOC;
-void* operator new[](size_t s) THROW_BAD_ALLOC;
+void* operator new(size_t s);
+void* operator new[](size_t s);
 
 void operator delete(void* mem) throw();
 void operator delete[](void* mem) throw();
 
-inline void* operator new(size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new(size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS)
 {
 	return pool.allocate(s ALLOC_PASS_ARGS);
 }
-inline void* operator new[](size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new[](size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS)
 {
 	return pool.allocate(s ALLOC_PASS_ARGS);
 }
 
-inline void operator delete(void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
+inline void operator delete(void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) noexcept
 {
 	MemoryPool::globalFree(mem);
 }
-inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
+inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) noexcept
 {
 	MemoryPool::globalFree(mem);
 }
 
 #ifdef DEBUG_GDS_ALLOC
 
-inline void* operator new(size_t s ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new(size_t s ALLOC_PARAMS)
 {
 	return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
 }
-inline void* operator new[](size_t s ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new[](size_t s ALLOC_PARAMS)
 {
 	return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
 }
 
-inline void operator delete(void* mem ALLOC_PARAMS) throw()
+inline void operator delete(void* mem ALLOC_PARAMS) noexcept
 {
 	MemoryPool::globalFree(mem);
 }
-inline void operator delete[](void* mem ALLOC_PARAMS) throw()
+inline void operator delete[](void* mem ALLOC_PARAMS) noexcept
 {
 	MemoryPool::globalFree(mem);
 }
-- 
2.13.0

