XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5df166..a8e304d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,7 +125,6 @@
include(XercesTranscoderSelection)
include(XercesFileMgrSelection)
include(XercesXMLCh)
-include(XercesOperatorDelete)
include(XercesLString)
include(XercesMFC)
include(XercesSSE2)
diff --git a/cmake/XercesOperatorDelete.cmake b/cmake/XercesOperatorDelete.cmake
deleted file mode 100644
index ff942ab..0000000
--- a/cmake/XercesOperatorDelete.cmake
+++ /dev/null
@@ -1,43 +0,0 @@
-# CMake build for xerces-c
-#
-# Written by Roger Leigh <rleigh@codelibre.net>
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Check whether the compiler chokes on a placement operator delete
-
-include(CheckCXXSourceCompiles)
-
-check_cxx_source_compiles("
-#include <cstdlib>
-
-class XMemory {
-public:
- void* operator new(size_t s) { return 0; }
- void* operator new(size_t s, void* ptr) { return 0; }
- void operator delete(void* p) {}
- void operator delete(void* p, void* ptr) {}
-};
-
-int main() {
- return 0;
-}"
- CXX_matching-delete-operator)
-
-set(XERCES_NO_MATCHING_DELETE_OPERATOR 0)
-if(NOT CXX_matching-delete-operator)
- set(XERCES_NO_MATCHING_DELETE_OPERATOR 1)
-endif()
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 64edf47..3f7066d 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -348,10 +348,6 @@
/* Define if there is support for L"widestring" */
#cmakedefine XERCES_LSTRSUPPORT 1
-/* Define to have XMemory.hpp avoid declaring a matching operator delete for
- the placement operator new */
-#cmakedefine XERCES_NO_MATCHING_DELETE_OPERATOR 1
-
/* Define to use backslash as an extra path delimiter character */
#cmakedefine XERCES_PATH_DELIMITER_BACKSLASH 1
diff --git a/configure.ac b/configure.ac
index 9df6bc9..ccf4f66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -366,27 +366,6 @@
XERCES_XMLCH_SELECTION
-AC_MSG_CHECKING([whether the compiler chokes on a placement operator delete])
-AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <cstdlib>
-
- class XMemory
- {
- public :
- void* operator new(size_t s) { return 0; }
- void* operator new(size_t s, void* ptr) { return 0; }
- void operator delete(void* p) {}
- void operator delete(void* p, void* ptr) {}
- };]],
- [[ ]])],
- [
- AC_MSG_RESULT([no])
- ],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED([XERCES_NO_MATCHING_DELETE_OPERATOR], 1, [Define to have XMemory.hpp avoid declaring a matching operator delete for the placement operator new])
- ]
- )
-
if test "$have_sse2" = "yes"; then
no_sse2_CXXFLAGS="$CXXFLAGS"
diff --git a/src/xercesc/dom/impl/DOMDocumentImpl.hpp b/src/xercesc/dom/impl/DOMDocumentImpl.hpp
index 81e03ab..797ceb1 100644
--- a/src/xercesc/dom/impl/DOMDocumentImpl.hpp
+++ b/src/xercesc/dom/impl/DOMDocumentImpl.hpp
@@ -490,12 +490,6 @@
return p;
}
-// ---------------------------------------------------------------------------
-// For DOM:
-// Bypass compiler warning:
-// no matching operator delete found; memory will not be freed if initialization throws an exception
-// ---------------------------------------------------------------------------
-#if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR)
inline void operator delete(void* /*ptr*/, xercesc::DOMDocumentImpl * /*doc*/, xercesc::DOMMemoryManager::NodeObjectType /*type*/)
{
return;
@@ -513,6 +507,5 @@
{
return;
}
-#endif
#endif
diff --git a/src/xercesc/util/XMemory.cpp b/src/xercesc/util/XMemory.cpp
index 28c2084..e5299cd 100644
--- a/src/xercesc/util/XMemory.cpp
+++ b/src/xercesc/util/XMemory.cpp
@@ -90,9 +90,6 @@
}
}
-//The Borland compiler is complaining about duplicate overloading of delete
-#if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR)
-
void XMemory::operator delete(void* p, MemoryManager* manager)
{
assert(manager != 0);
@@ -118,7 +115,5 @@
{
}
-#endif
-
}
diff --git a/src/xercesc/util/XMemory.hpp b/src/xercesc/util/XMemory.hpp
index 02b6f4f..9235a4c 100644
--- a/src/xercesc/util/XMemory.hpp
+++ b/src/xercesc/util/XMemory.hpp
@@ -96,8 +96,6 @@
*/
void operator delete(void* p);
- //The Borland compiler is complaining about duplicate overloading of delete
-#if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR)
/**
* This method provides a matching delete for the custom operator new
*
@@ -113,7 +111,6 @@
* @param ptr The memory location where the object had to be allocated
*/
void operator delete(void* p, void* ptr);
-#endif
//@}
diff --git a/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in b/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in
index d76657f..79063d5 100644
--- a/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in
+++ b/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in
@@ -74,8 +74,6 @@
#cmakedefine XERCES_HAVE_SSE2_INTRINSIC 1
#cmakedefine XERCES_HAVE_GETCPUID 1
-#cmakedefine XERCES_NO_MATCHING_DELETE_OPERATOR 1
-
#cmakedefine XERCES_DLL_EXPORT 1
#cmakedefine XERCES_STATIC_LIBRARY 1
#define XERCES_PLATFORM_EXPORT @XERCES_PLATFORM_EXPORT@
diff --git a/src/xercesc/util/Xerces_autoconf_config.hpp.in b/src/xercesc/util/Xerces_autoconf_config.hpp.in
index d361485..cd9f04d 100644
--- a/src/xercesc/util/Xerces_autoconf_config.hpp.in
+++ b/src/xercesc/util/Xerces_autoconf_config.hpp.in
@@ -78,8 +78,6 @@
#undef XERCES_PLATFORM_IMPORT
#undef XERCES_TEMPLATE_EXTERN
-#undef XERCES_NO_MATCHING_DELETE_OPERATOR
-
// ---------------------------------------------------------------------------
// Include standard headers, if available, that we may rely on below.
// ---------------------------------------------------------------------------