File Libreoffice-patch-C-11-new-delete-replacement-functi.patch of Package firebird
From: mapopa <mapopa@65644016-39b1-43b1-bf79-96bc8fe82c15>
Date: Wed, 3 Jun 2015 08:22:32 +0000
Subject: Libreoffice patch : C++11: new/delete replacement
functions cannot be inline
https://www.mail-archive.com/libreoffice@lists.freedesktop.org/msg79870.html
Patch-mainline: v2.5.5
Git-commit: 98f8bc43e98348929b4fa9906c8cef29542e9b8e
git-svn-id: svn+ssh://svn.code.sf.net/p/firebird/code/firebird/branches/B2_5_Release@61702 65644016-39b1-43b1-bf79-96bc8fe82c15
---
src/common/classes/alloc.cpp | 18 ++++++++++++++++++
src/common/classes/alloc.h | 20 ++++----------------
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp
index 41c242b79159..5e9167585984 100644
--- a/src/common/classes/alloc.cpp
+++ b/src/common/classes/alloc.cpp
@@ -2103,3 +2103,21 @@ void AutoStorage::ProbeStack() const
#endif
} // namespace Firebird
+
+void* operator new(size_t s) THROW_BAD_ALLOC
+{
+ return Firebird::MemoryPool::globalAlloc(s);
+}
+void* operator new[](size_t s) THROW_BAD_ALLOC
+{
+ return Firebird::MemoryPool::globalAlloc(s);
+}
+
+void operator delete(void* mem) throw()
+{
+ Firebird::MemoryPool::globalFree(mem);
+}
+void operator delete[](void* mem) throw()
+{
+ Firebird::MemoryPool::globalFree(mem);
+}
diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h
index 8684b3d88a99..6d4136235e8e 100644
--- a/src/common/classes/alloc.h
+++ b/src/common/classes/alloc.h
@@ -492,23 +492,11 @@ using Firebird::MemoryPool;
inline static MemoryPool* getDefaultMemoryPool() { return Firebird::MemoryPool::processMemoryPool; }
// Global versions of operators new and delete
-inline void* operator new(size_t s) THROW_BAD_ALLOC
-{
- return Firebird::MemoryPool::globalAlloc(s);
-}
-inline void* operator new[](size_t s) THROW_BAD_ALLOC
-{
- return Firebird::MemoryPool::globalAlloc(s);
-}
+void* operator new(size_t s) THROW_BAD_ALLOC;
+void* operator new[](size_t s) THROW_BAD_ALLOC;
-inline void operator delete(void* mem) throw()
-{
- Firebird::MemoryPool::globalFree(mem);
-}
-inline void operator delete[](void* mem) throw()
-{
- Firebird::MemoryPool::globalFree(mem);
-}
+void operator delete(void* mem) throw();
+void operator delete[](void* mem) throw();
#ifdef DEBUG_GDS_ALLOC
inline void* operator new(size_t s, Firebird::MemoryPool& pool, const char* file, int line)
--
2.4.6