summaryrefslogtreecommitdiff
path: root/external/firebird
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-30 09:22:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-10-30 09:28:33 +0100
commit542a3291005dc1db011c76f437d5e0b945fa726e (patch)
tree179da70c42ab0c4aa854db9a3d93826ed0d190be /external/firebird
parent71077148d442b3bbfeefd9a572942946c6a95823 (diff)
C++11: new/delete replacement functions cannot be inline
...as clarified by a new sentence added to paragraph 3 of 17.6.4.6 [replacement.functions]: "The program’s definitions shall not be specified as inline." Clang trunk towards 3.4 now generates errors for this. Having these replacement functions in the fbembed dynamic library is extremely fishy anyway; at least on Linux those symbols are not exported, and hopefully on no other platforms either. (If it turns out that this change causes the symbols to change from non-exported to exported on some other platform, the best fix would probably be to remove those replacement functions completely.) Change-Id: I590d55e44814a6707030c42e1087377e75819666
Diffstat (limited to 'external/firebird')
-rw-r--r--external/firebird/UnpackedTarball_firebird.mk4
-rw-r--r--external/firebird/firebird-c++11replfn.patch.054
2 files changed, 55 insertions, 3 deletions
diff --git a/external/firebird/UnpackedTarball_firebird.mk b/external/firebird/UnpackedTarball_firebird.mk
index c4119a022bb7..77e691c146ac 100644
--- a/external/firebird/UnpackedTarball_firebird.mk
+++ b/external/firebird/UnpackedTarball_firebird.mk
@@ -14,10 +14,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,firebird,$(FIREBIRD_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,firebird,\
external/firebird/firebird-icu.patch.1 \
external/firebird/firebird-rpath.patch.0 \
-))
-
-$(eval $(call gb_UnpackedTarball_add_patches,firebird,\
external/firebird/firebird-c++11.patch.1 \
+ external/firebird/firebird-c++11replfn.patch.0 \
))
ifeq ($(OS)-$(COM),WNT-MSC)
diff --git a/external/firebird/firebird-c++11replfn.patch.0 b/external/firebird/firebird-c++11replfn.patch.0
new file mode 100644
index 000000000000..d14296ccfa08
--- /dev/null
+++ b/external/firebird/firebird-c++11replfn.patch.0
@@ -0,0 +1,54 @@
+--- src/common/classes/alloc.h
++++ src/common/classes/alloc.h
+@@ -489,23 +489,11 @@
+ 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)
+--- src/common/classes/alloc.cpp
++++ src/common/classes/alloc.cpp
+@@ -2080,3 +2080,21 @@
+ #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);
++}