Kaydet (Commit) 542a3291 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 71077148
......@@ -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)
......
--- 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);
+}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment