Revert changes in NewDelete.cpp for throw()
As part of the commit fa0f42d, we replaced throw with _GLIBC_THROW or
_GLIBC_USE_NO_EXCEPT for supporting gcc's implementation of C++11, but
it didn't really work. Reverting back these changes and will revist this
as a separate JIRA for adding gcc's implementation of C++11.
Co-authored-by: Nikhil Kak <nkak@vmware.com>
diff --git a/src/ports/postgres/dbconnector/NewDelete.cpp b/src/ports/postgres/dbconnector/NewDelete.cpp
index 8f909a8..a4de2df 100644
--- a/src/ports/postgres/dbconnector/NewDelete.cpp
+++ b/src/ports/postgres/dbconnector/NewDelete.cpp
@@ -26,11 +26,6 @@
// the search paths, which might point to a port-specific dbconnector.hpp
#include <dbconnector/dbconnector.hpp>
-#ifdef _LIBCPP_COMPILER_CLANG
-#define _GLIBCXX_THROW(a) throw(a)
-#define _GLIBCXX_USE_NOEXCEPT noexcept
-#endif
-
/**
* @brief operator new for PostgreSQL. Throw on fail.
*
@@ -39,7 +34,7 @@
* that size.
*/
void*
-operator new(std::size_t size) _GLIBCXX_THROW (std::bad_alloc) {
+operator new(std::size_t size) throw (std::bad_alloc) {
return madlib::defaultAllocator().allocate<
madlib::dbal::FunctionContext,
madlib::dbal::DoNotZero,
@@ -47,7 +42,7 @@
}
void*
-operator new[](std::size_t size) _GLIBCXX_THROW (std::bad_alloc) {
+operator new[](std::size_t size) throw (std::bad_alloc) {
return madlib::defaultAllocator().allocate<
madlib::dbal::FunctionContext,
madlib::dbal::DoNotZero,
@@ -63,12 +58,12 @@
* <tt>operator new(std::size_t)</tt>.
*/
void
-operator delete(void *ptr) _GLIBCXX_USE_NOEXCEPT {
+operator delete(void *ptr) throw() {
madlib::defaultAllocator().free<madlib::dbal::FunctionContext>(ptr);
}
void
-operator delete[](void *ptr) _GLIBCXX_USE_NOEXCEPT {
+operator delete[](void *ptr) throw() {
madlib::defaultAllocator().free<madlib::dbal::FunctionContext>(ptr);
}
@@ -80,7 +75,7 @@
* indication, instead of a bad_alloc exception.
*/
void*
-operator new(std::size_t size, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT {
+operator new(std::size_t size, const std::nothrow_t&) throw() {
return madlib::defaultAllocator().allocate<
madlib::dbal::FunctionContext,
madlib::dbal::DoNotZero,
@@ -88,7 +83,7 @@
}
void*
-operator new[](std::size_t size, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT {
+operator new[](std::size_t size, const std::nothrow_t&) throw() {
return madlib::defaultAllocator().allocate<
madlib::dbal::FunctionContext,
madlib::dbal::DoNotZero,
@@ -102,11 +97,11 @@
* <tt>operator new(std::size_t, const std::nothrow_t&)</tt>.
*/
void
-operator delete(void *ptr, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT {
+operator delete(void *ptr, const std::nothrow_t&) throw() {
madlib::defaultAllocator().free<madlib::dbal::FunctionContext>(ptr);
}
void
-operator delete[](void *ptr, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT {
+operator delete[](void *ptr, const std::nothrow_t&) throw() {
madlib::defaultAllocator().free<madlib::dbal::FunctionContext>(ptr);
}