You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2009/08/04 10:55:01 UTC

svn commit: r800703 - in /xerces/c/trunk: configure.ac src/xercesc/util/Xerces_autoconf_config.hpp.in

Author: amassari
Date: Tue Aug  4 08:55:01 2009
New Revision: 800703

URL: http://svn.apache.org/viewvc?rev=800703&view=rev
Log:
Add an autoconf test to verify if the compiler supports the matching operator delete (XERCESC-1380)

Modified:
    xerces/c/trunk/configure.ac
    xerces/c/trunk/src/xercesc/util/Xerces_autoconf_config.hpp.in

Modified: xerces/c/trunk/configure.ac
URL: http://svn.apache.org/viewvc/xerces/c/trunk/configure.ac?rev=800703&r1=800702&r2=800703&view=diff
==============================================================================
--- xerces/c/trunk/configure.ac (original)
+++ xerces/c/trunk/configure.ac Tue Aug  4 08:55:01 2009
@@ -55,7 +55,8 @@
 
 # Checks for programs.
 AC_PROG_CXX
-AC_PROG_CC
+# Use the C++ compiler for the compile tests
+AC_LANG(C++)
 # used by "make check"
 AC_PROG_SED
 #it would be nice to also check for PERL...
@@ -255,10 +256,10 @@
                                      [[DeleteFileW(file);]])],
                     [
                       xerces_cv_type_xmlch=wchar_t
-                   	  AC_MSG_RESULT([yes])
+                      AC_MSG_RESULT([yes])
                       AC_DEFINE_UNQUOTED([XERCES_INCLUDE_WCHAR_H], 1, [Define to have Xerces_autoconf_config.hpp include wchar.h])
                     ],
-	                [
+                    [
                       xerces_cv_type_xmlch=$xerces_cv_type_u16bit_int
                       AC_MSG_RESULT([no])
                     ]
@@ -266,6 +267,28 @@
 
 AC_DEFINE_UNQUOTED([XERCES_XMLCH_T], [$xerces_cv_type_xmlch], [Define to the 16 bit type used to represent Xerces UTF-16 characters])
 
+AC_MSG_CHECKING([whether the compiler chokes on a placement operator delete])
+AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <stdlib.h>
+                                        
+                                        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])
+                    ]
+                 )
+
+
 AS_IF([test x$ac_cv_type_size_t = xyes],
 	AC_DEFINE([XERCES_SIZE_T], [size_t], [Define as the appropriate size_t type]),
 	AC_DEFINE([XERCES_SIZE_T], [long], [Define as the appropriate size_t type]))

Modified: xerces/c/trunk/src/xercesc/util/Xerces_autoconf_config.hpp.in
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Xerces_autoconf_config.hpp.in?rev=800703&r1=800702&r2=800703&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Xerces_autoconf_config.hpp.in (original)
+++ xerces/c/trunk/src/xercesc/util/Xerces_autoconf_config.hpp.in Tue Aug  4 08:55:01 2009
@@ -75,6 +75,8 @@
 #undef XERCES_PLATFORM_EXPORT
 #undef XERCES_PLATFORM_IMPORT
 
+#undef XERCES_NO_MATCHING_DELETE_OPERATOR
+
 // ---------------------------------------------------------------------------
 //  Include standard headers, if available, that we may rely on below.
 // ---------------------------------------------------------------------------



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