You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by rl...@apache.org on 2020/06/10 21:57:10 UTC

[xerces-c] branch master updated: XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler

This is an automated email from the ASF dual-hosted git repository.

rleigh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xerces-c.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a721ad  XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler
     new 8db2383  Merge pull request #19 from rleigh-codelibre/XERCESC-2210_Remove_XERCES_NO_MATCHING_DELETE_OPERATOR
5a721ad is described below

commit 5a721ad3f513005ec4dda63de84b7143121e746e
Author: Roger Leigh <rl...@codelibre.net>
AuthorDate: Wed Jun 10 20:21:00 2020 +0100

    XERCESC-2110: Remove XERCES_NO_MATCHING_DELETE_OPERATOR for old Borland compiler
---
 CMakeLists.txt                                     |  1 -
 cmake/XercesOperatorDelete.cmake                   | 43 ----------------------
 config.h.cmake.in                                  |  4 --
 configure.ac                                       | 21 -----------
 src/xercesc/dom/impl/DOMDocumentImpl.hpp           |  7 ----
 src/xercesc/util/XMemory.cpp                       |  5 ---
 src/xercesc/util/XMemory.hpp                       |  3 --
 .../util/Xerces_autoconf_config.hpp.cmake.in       |  2 -
 src/xercesc/util/Xerces_autoconf_config.hpp.in     |  2 -
 9 files changed, 88 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5df166..a8e304d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,7 +125,6 @@ include(XercesMsgLoaderSelection)
 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 <rl...@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 @@ AC_DEFINE_UNQUOTED([XERCES_TEMPLATE_EXTERN], [$template_extern], [Define as the
 
 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 @@ inline void * operator new(size_t amt, xercesc::DOMDocument *doc)
     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 @@ inline void operator delete(void* /*ptr*/, xercesc::DOMDocument * /*doc*/)
 {
     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 @@ void XMemory::operator delete(void* p)
     }
 }
 
-//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 @@ void XMemory::operator delete(void* /*p*/, void* /*ptr*/)
 {
 }
 
-#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 @@ public :
       */
     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 @@ public :
       * @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.
 // ---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org