You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by bo...@apache.org on 2008/02/22 18:15:03 UTC

svn commit: r630254 - in /xerces/c/trunk: configure.ac m4/xerces_msgloader_selection.m4 m4/xerces_netaccessor_selection.m4 src/xercesc/util/PlatformUtils.cpp

Author: borisk
Date: Fri Feb 22 09:14:49 2008
New Revision: 630254

URL: http://svn.apache.org/viewvc?rev=630254&view=rev
Log:
Make inmemory and socket default message loader and net accessor, respectively. Add --disable-network option to build without network support.

Modified:
    xerces/c/trunk/configure.ac
    xerces/c/trunk/m4/xerces_msgloader_selection.m4
    xerces/c/trunk/m4/xerces_netaccessor_selection.m4
    xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp

Modified: xerces/c/trunk/configure.ac
URL: http://svn.apache.org/viewvc/xerces/c/trunk/configure.ac?rev=630254&r1=630253&r2=630254&view=diff
==============================================================================
--- xerces/c/trunk/configure.ac (original)
+++ xerces/c/trunk/configure.ac Fri Feb 22 09:14:49 2008
@@ -9,9 +9,9 @@
 # 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.
@@ -79,10 +79,6 @@
 AS_IF([test x$AR = xfalse],
 	AC_MSG_ERROR([Cannot find a valid 'ar' tool]))
 
-# Checks for libraries.
-AC_CHECK_LIB([socket], [socket])
-AC_CHECK_LIB([nsl], [gethostbyname])
-
 # Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_TIME
@@ -138,37 +134,37 @@
 # positive on HP-UX, so we use a different snippet to set the
 # corresponding macro
 AC_MSG_CHECKING([for mbrlen])
-AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>]], 
+AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>]],
                                      [[mbstate_t st; mbrlen( "t", 5, &st );]])],
-                    [ 
+                    [
                       AC_MSG_RESULT([yes])
                       AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 1, [Define to 1 if you have the `mbrlen' function.])
                     ],
-                    [ 
+                    [
                       AC_MSG_RESULT([no])
                       AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 0, [Define to 1 if you have the `mbrlen' function.])
                     ]
                  )
 AC_MSG_CHECKING([for wcsrtombs])
-AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>]], 
+AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>]],
                                      [[mbstate_t st; char buffer[2]; wchar_t src[2]; wcsrtombs(buffer, &src, 2, &st);]])],
-                    [ 
+                    [
                       AC_MSG_RESULT([yes])
                       AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.])
                     ],
-                    [ 
+                    [
                       AC_MSG_RESULT([no])
                       AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if you have the `wcsrtombs' function.])
                     ]
                  )
 AC_MSG_CHECKING([for mbsrtowcs])
-AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>]], 
+AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>]],
                                      [[mbstate_t st; wchar_t buffer[2]; char src[2]; mbsrtowcs(buffer, &src, 2, &st);]])],
-                    [ 
+                    [
                       AC_MSG_RESULT([yes])
                       AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 if you have the `mbsrtowcs' function.])
                     ],
-                    [ 
+                    [
                       AC_MSG_RESULT([no])
                       AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if you have the `mbsrtowcs' function.])
                     ]
@@ -194,9 +190,6 @@
 XERCES_PRETTY_MAKE
 XERCES_PATH_DELIMITERS
 
-XERCES_CURL_PREFIX
-XERCES_LIBWWW_PREFIX
-
 XERCES_NETACCESSOR_SELECTION
 XERCES_TRANSCODER_SELECTION
 XERCES_MSGLOADER_SELECTION
@@ -204,6 +197,7 @@
 XERCES_MUTEXMGR_SELECTION
 XERCES_ATOMICOPMGR_SELECTION
 
+
 ######################################################
 # Define some namespace-protected macros for use in the publicly visible
 # XercesConfig.h file.
@@ -243,17 +237,17 @@
 *-*-msdos* | *-*-mingw32* | *-*-cygwin* | *-*-windows* )
 	platform_export="__declspec(dllexport)"
 	platform_import="__declspec(dllimport)"
-	;; 
+	;;
 * )
 	case $COMPILER in
 	SUNPRO)
 		platform_export="__declspec(dllexport)"
 		platform_import="__declspec(dllimport)"
-		;; 
+		;;
 	*)
 		platform_export=""
 		platform_import=""
-		;; 
+		;;
 	esac
 esac
 AC_DEFINE_UNQUOTED([XERCES_PLATFORM_EXPORT], [$platform_export], [Define as the platform's export attribute])
@@ -269,9 +263,9 @@
 # (this is safe because on Windows wchar_t is used to store UTF-16 codepoints, while it is not true on Unix)
 AC_MSG_CHECKING([whether the Windows SDK is available and using wchar_t as wide string])
 AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <windows.h>
-                                        wchar_t file[] = L"dummy.file";]], 
+                                        wchar_t file[] = L"dummy.file";]],
                                      [[DeleteFileW(file);]])],
-                    [ 
+                    [
                       xerces_cv_type_xmlch=wchar_t
                    	  AC_MSG_RESULT([yes])
                       AC_DEFINE_UNQUOTED([XERCES_INCLUDE_WCHAR_H], 1, [Define to have Xerces_autoconf_config.hpp include wchar.h])
@@ -283,21 +277,21 @@
                  )
 
 AC_DEFINE_UNQUOTED([XERCES_XMLCH_T], [$xerces_cv_type_xmlch], [Define to the 16 bit type used to represent Xerces UTF-16 characters])
-	
+
 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]))
-	
+
 AS_IF([test x$ac_cv_type_ssize_t = xyes],
 	AC_DEFINE([XERCES_SSIZE_T], [ssize_t], [Define as the appropriate ssize_t type]),
 	AC_DEFINE([XERCES_SSIZE_T], [unsigned long], [Define as the appropriate ssize_t type]))
-	
+
 AS_IF([test x$ac_cv_cxx_have_namespaces = xyes],
 	AC_DEFINE([XERCES_HAS_CPP_NAMESPACE], 1, [Define if namespaces is supported by the compiler]))
-	
+
 AS_IF([test x$ac_cv_cxx_have_std_namespace = xyes],
 	AC_DEFINE([XERCES_STD_NAMESPACE], 1, [Define if the std namespace is supported]))
-	
+
 AS_IF([test x$ac_cv_cxx_have_std_libs = xyes],
 	AC_DEFINE([XERCES_NEW_IOSTREAMS], 1, [Define if the isstream library can be included as <iostream>]))
 

Modified: xerces/c/trunk/m4/xerces_msgloader_selection.m4
URL: http://svn.apache.org/viewvc/xerces/c/trunk/m4/xerces_msgloader_selection.m4?rev=630254&r1=630253&r2=630254&view=diff
==============================================================================
--- xerces/c/trunk/m4/xerces_msgloader_selection.m4 (original)
+++ xerces/c/trunk/m4/xerces_msgloader_selection.m4 Fri Feb 22 09:14:49 2008
@@ -18,9 +18,9 @@
 	# If the msgloader has been explicitly "enable"d, then vote for it strongly,
 	# in upper case.
 	######################################################
-	
+
 	ml_list=
-	
+
 	# Check for inmemory msgloader
 	AC_MSG_CHECKING([whether we support the InMemory MsgLoader])
 	list_add=
@@ -36,7 +36,7 @@
 		[ml_list="$ml_list -$list_add-"; AC_MSG_RESULT(yes)],
 		[AC_MSG_RESULT(no)]
 	)
-	
+
 	# Check for ICU
 	AC_REQUIRE([XERCES_ICU_PREFIX])
 	AC_MSG_CHECKING([whether we support the ICU MsgLoader])
@@ -74,8 +74,8 @@
 	)
 
 	# TODO: Add test for additional msgloaders
-	
-	
+
+
 	######################################################
 	# Determine which msgloader to use.
 	#
@@ -89,21 +89,21 @@
 	for i in 1 2; do
 		# Swap upper/lower case in the ml_list
 		ml_list=`echo $ml_list | tr '[a-z][A-Z]' '[A-Z][a-z]'`
-		
+
 		# Check for each msgloader, in implicit rank order
 		case $ml_list in
+		*-inmemory-*)
+			AC_DEFINE([XERCES_USE_MSGLOADER_INMEMORY], 1, [Define to use the InMemory MsgLoader])
+			msgloader=inmemory
+			break
+			;;
+
 		*-icu-*)
 			AC_DEFINE([XERCES_USE_MSGLOADER_ICU], 1, [Define to use the ICU-based MsgLoader])
 			msgloader=icu
 			LIBS="${LIBS} -L${xerces_cv_icu_prefix}/lib -licuuc -licudata"
 			break
 			;;
-			
-		*-inmemory-*)
-			AC_DEFINE([XERCES_USE_MSGLOADER_INMEMORY], 1, [Define to use the InMemory MsgLoader])
-			msgloader=inmemory
-			break
-			;;
 
 		*-iconv-*)
 			AC_DEFINE([XERCES_USE_MSGLOADER_ICONV], 1, [Define to use the iconv-based MsgLoader])
@@ -123,13 +123,13 @@
 	if test x"$msgloader" != x; then
 		AC_MSG_RESULT($msgloader)
 	fi
-	
+
 	# Define the auto-make conditionals which determine what actually gets compiled
 	# Note that these macros can't be executed conditionally, which is why they're here, not above.
 	AM_CONDITIONAL([XERCES_USE_MSGLOADER_ICU], 	[test x"$msgloader" = xicu])
 	AM_CONDITIONAL([XERCES_USE_MSGLOADER_ICONV], 	[test x"$msgloader" = xiconv])
 	AM_CONDITIONAL([XERCES_USE_MSGLOADER_INMEMORY],	[test x"$msgloader" = xinmemory])
-	
+
 	]
 )
 

Modified: xerces/c/trunk/m4/xerces_netaccessor_selection.m4
URL: http://svn.apache.org/viewvc/xerces/c/trunk/m4/xerces_netaccessor_selection.m4?rev=630254&r1=630253&r2=630254&view=diff
==============================================================================
--- xerces/c/trunk/m4/xerces_netaccessor_selection.m4 (original)
+++ xerces/c/trunk/m4/xerces_netaccessor_selection.m4 Fri Feb 22 09:14:49 2008
@@ -12,15 +12,34 @@
 AC_DEFUN([XERCES_NETACCESSOR_SELECTION],
 	[
 
+	network=yes
+	AC_ARG_ENABLE(
+	  [network],
+	  AS_HELP_STRING([--disable-network], [Disable network support]),
+	  [AS_IF([test x"$enableval" = xno], [network=no])])
+
+	# If network is disabled we don't need to check any of the
+	# netaccessors.
+	#
+	na_list=
+
+	if test x"$network" == xyes; then
+
+	# Checks for libraries.
+	AC_CHECK_LIB([socket], [socket])
+	AC_CHECK_LIB([nsl], [gethostbyname])
+
+        XERCES_CURL_PREFIX
+        XERCES_LIBWWW_PREFIX
+
 	######################################################
 	# Test for availability of each netaccessor on this host.
 	# For each netaccessor that's available, and hasn't been disabled, add it to our list.
 	# If the netaccessor has been explicitly "enable"d, then vote for it strongly,
 	# in upper case.
 	######################################################
-	na_list=
-	
-	AC_REQUIRE([XERCES_CURL_PREFIX])	
+
+	AC_REQUIRE([XERCES_CURL_PREFIX])
 	AC_MSG_CHECKING([whether we can support the libcurl-based NetAccessor])
 	list_add=
 	AS_IF([test x"$xerces_cv_curl_prefix" != x], [
@@ -35,8 +54,8 @@
 		[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
 		[AC_MSG_RESULT(no)]
 	)
-	
-	AC_REQUIRE([XERCES_LIBWWW_PREFIX])	
+
+	AC_REQUIRE([XERCES_LIBWWW_PREFIX])
 	AC_MSG_CHECKING([whether we can support the libwww-based NetAccessor])
 	list_add=
 	AS_IF([test x"$xerces_cv_libwww_prefix" != x], [
@@ -51,8 +70,8 @@
 		[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
 		[AC_MSG_RESULT(no)]
 	)
-	
-	
+
+
 	AC_MSG_CHECKING([whether we can support the sockets-based NetAccessor])
 	list_add=
 	AS_IF([test x"$ac_cv_header_sys_socket_h" = xyes],
@@ -67,7 +86,7 @@
 		[na_list="$na_list -$list_add-"; AC_MSG_RESULT(yes)],
 		[AC_MSG_RESULT(no)]
 	)
-	
+
 	# Check for OS-specific transcoders
 	case $host_os in
 	darwin*)
@@ -106,8 +125,8 @@
 		)
 		;;
 	esac
-		
-	
+
+
 	######################################################
 	# Determine which netaccessor to use.
 	#
@@ -121,56 +140,60 @@
 	for i in 1 2; do
 		# Swap upper/lower case in string:
 		na_list=`echo $na_list | tr '[a-z][A-Z]' '[A-Z][a-z]'`
-		
+
 		# Check for each netaccessor, in implicit rank order
 		case $na_list in
-		
+		*-winsock-*)
+			netaccessor=winsock
+			AC_DEFINE([XERCES_USE_NETACCESSOR_WINSOCK], 1, [Define to use the WinSock NetAccessor])
+			break
+			;;
+
+		*-socket-*)
+			netaccessor=socket
+			AC_DEFINE([XERCES_USE_NETACCESSOR_SOCKET], 1, [Define to use the Sockets-based NetAccessor])
+			break
+			;;
+
 		*-curl-*)
 			netaccessor=curl
 			AC_DEFINE([XERCES_USE_NETACCESSOR_CURL], 1, [Define to use the CURL NetAccessor])
 			LIBS="${LIBS} -L${xerces_cv_curl_prefix}/lib -lcurl"
 			break
 			;;
-			
+
 		*-cfurl-*)
 			netaccessor=cfurl
 			AC_DEFINE([XERCES_USE_NETACCESSOR_CFURL], 1, [Define to use the Mac OS X CFURL NetAccessor])
 			XERCES_LINK_DARWIN_FRAMEWORK([CoreServices])
 			break
 			;;
-			
-		*-winsock-*)
-			netaccessor=winsock
-			AC_DEFINE([XERCES_USE_NETACCESSOR_WINSOCK], 1, [Define to use the WinSock NetAccessor])
-			break
-			;;
-			
-		*-socket-*)
-			netaccessor=socket
-			AC_DEFINE([XERCES_USE_NETACCESSOR_SOCKET], 1, [Define to use the Sockets-based NetAccessor])
-			break
-			;;
-			
+
 		*-libwww-*)
 			netaccessor=libwww
 			AC_DEFINE([XERCES_USE_NETACCESSOR_LIBWWW], 1, [Define to use the libwww NetAccessor])
 			LIBS="${LIBS} `${xerces_cv_libwww_prefix}/bin/libwww-config --prefix=${xerces_cv_libwww_prefix} --libs`"
 			break
 			;;
-			
+
 		*)
 			AS_IF([test $i -eq 2], [
 				AC_MSG_RESULT([none available; there will be no network access!!!])
 				]
 			)
 			;;
-			
+
 		esac
 	done
+
 	if test x"$netaccessor" != x; then
 		AC_MSG_RESULT($netaccessor)
 	fi
-	
+
+	else # network
+		netaccessor=disabled # for the report
+	fi
+
 	# Define the auto-make conditionals which determine what actually gets compiled
 	# Note that these macros can't be executed conditionally, which is why they're here, not above.
 	AM_CONDITIONAL([XERCES_USE_NETACCESSOR_CURL],		[test x"$netaccessor" = xcurl])

Modified: xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp?rev=630254&r1=630253&r2=630254&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp Fri Feb 22 09:14:49 2008
@@ -5,9 +5,9 @@
  * 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.
@@ -188,7 +188,7 @@
 // ---------------------------------------------------------------------------
 //  XMLPlatformUtils: Init/term methods
 // ---------------------------------------------------------------------------
-void XMLPlatformUtils::Initialize(const char*          const locale 
+void XMLPlatformUtils::Initialize(const char*          const locale
                                 , const char*          const nlsHome
                                 ,       PanicHandler*  const panicHandler
                                 ,       MemoryManager* const memoryManager
@@ -205,7 +205,7 @@
     //
     if (gInitFlag == LONG_MAX)
         return;
-	
+
     //
     //  Make sure we haven't already been initialized. Note that this is not
     //  thread safe and is not intended for that. Its more for those COM
@@ -243,8 +243,8 @@
     {
         fgUserPanicHandler = panicHandler;
     }
-    
-    
+
+
     // Determine our endianness (with regard to a XMLCh 16-bit word)
     union {
     	XMLCh ch;
@@ -252,14 +252,14 @@
     } endianTest;
     endianTest.ch = 1;
     fgXMLChBigEndian = (endianTest.ar[sizeof(XMLCh)-1] == 1);
-    
-    
+
+
     // Initialize the platform-specific mutex file, and atomic op mgrs
     fgMutexMgr		= makeMutexMgr(fgMemoryManager);
     fgAtomicOpMgr	= makeAtomicOpMgr(fgMemoryManager);
     fgFileMgr		= makeFileMgr(fgMemoryManager);
-    
-    
+
+
     // Create the local sync mutex
     gSyncMutex = new XMLMutex(fgMemoryManager);
 
@@ -306,8 +306,8 @@
     /***
      * Message Loader:
      *
-     *     Locale setting 
-     *     nlsHome setting 
+     *     Locale setting
+     *     nlsHome setting
      ***/
     XMLMsgLoader::setLocale(locale);
     XMLMsgLoader::setNLSHome(nlsHome);
@@ -330,7 +330,7 @@
         return;
 
 	gInitFlag--;
-	
+
 	if (gInitFlag > 0)
 		return;
 
@@ -368,7 +368,7 @@
 	delete fgFileMgr;		fgFileMgr = 0;
 	delete fgAtomicOpMgr;	fgAtomicOpMgr = 0;
 	delete fgMutexMgr;		fgMutexMgr = 0;
-	
+
     /***
      *  de-allocate resource
      *
@@ -402,7 +402,7 @@
 // ---------------------------------------------------------------------------
 void XMLPlatformUtils::panic(const PanicHandler::PanicReasons reason)
 {
-    fgUserPanicHandler? fgUserPanicHandler->panic(reason) : fgDefaultPanicHandler->panic(reason);	
+    fgUserPanicHandler? fgUserPanicHandler->panic(reason) : fgDefaultPanicHandler->panic(reason);
 }
 
 
@@ -414,20 +414,18 @@
 XMLNetAccessor* XMLPlatformUtils::makeNetAccessor()
 {
 	XMLNetAccessor* na = 0;
-	
-	#if defined (XERCES_USE_NETACCESSOR_CURL)
+
+#if defined (XERCES_USE_NETACCESSOR_CURL)
 		na = new CurlNetAccessor();
-	#elif defined (XERCES_USE_NETACCESSOR_SOCKET)
+#elif defined (XERCES_USE_NETACCESSOR_SOCKET)
 		na = new SocketNetAccessor();
-	#elif defined (XERCES_USE_NETACCESSOR_LIBWWW)
+#elif defined (XERCES_USE_NETACCESSOR_LIBWWW)
 		na = new LibWWWNetAccessor();
-	#elif defined (XERCES_USE_NETACCESSOR_CFURL)
+#elif defined (XERCES_USE_NETACCESSOR_CFURL)
 		na = new MacOSURLAccessCF();
-    #elif defined (XERCES_USE_NETACCESSOR_WINSOCK)
+#elif defined (XERCES_USE_NETACCESSOR_WINSOCK)
 		na = new WinSockNetAccessor();
-	#else
-		#warning No NetAccessor is configured for this platform. Xerces will have no net access.
-	#endif
+#endif
 
 	return na;
 }
@@ -441,7 +439,7 @@
 XMLMsgLoader* XMLPlatformUtils::loadAMsgSet(const XMLCh* const msgDomain)
 {
     XMLMsgLoader* ms=0;
-    
+
     try
     {
 	#if defined (XERCES_USE_MSGLOADER_ICU)
@@ -464,7 +462,7 @@
     {
         panic(PanicHandler::Panic_CantLoadMsgDomain);
     }
-    
+
     return ms;
 }
 
@@ -479,7 +477,7 @@
 XMLTransService* XMLPlatformUtils::makeTransService()
 {
 	XMLTransService* tc = 0;
-	
+
 	#if defined   (XERCES_USE_TRANSCODER_ICU)
 		tc = new ICUTransService;
 	#elif defined (XERCES_USE_TRANSCODER_GNUICONV)
@@ -493,7 +491,7 @@
 	#else
 		#error No Transcoder configured for platform! You must configure it.
 	#endif
-	
+
 	return tc;
 }
 
@@ -505,7 +503,7 @@
 XMLPlatformUtils::makeFileMgr(MemoryManager* const memmgr)
 {
 	XMLFileMgr* mgr = NULL;
-	
+
 	#if XERCES_USE_FILEMGR_POSIX
 		mgr = new (memmgr) PosixFileMgr;
 	#elif XERCES_USE_FILEMGR_WINDOWS
@@ -513,7 +511,7 @@
 	#else
 		#error No File Manager configured for platform! You must configure it.
 	#endif
-	
+
 	return mgr;
 }
 
@@ -672,7 +670,7 @@
 
 
 inline bool
-XMLPlatformUtils::isAnySlash(XMLCh c) 
+XMLPlatformUtils::isAnySlash(XMLCh c)
 {
 	// As far as we know, all supported Xerces
 	// platforms use at least a forward slash
@@ -701,7 +699,7 @@
 unsigned long XMLPlatformUtils::getCurrentMillis()
 {
 	unsigned long ms = 0;
-	
+
 	// *** TODO: additional platform support?
 	#if HAVE_GETTIMEOFDAY
 		struct timeval aTime;
@@ -726,7 +724,7 @@
 XMLMutexMgr* XMLPlatformUtils::makeMutexMgr(MemoryManager* const memmgr)
 {
 	XMLMutexMgr* mgr = NULL;
-	
+
 	#if XERCES_USE_MUTEXMGR_NOTHREAD
 		mgr = new (memmgr) NoThreadMutexMgr;
 	#elif XERCES_USE_MUTEXMGR_POSIX
@@ -736,7 +734,7 @@
 	#else
 		#error No Mutex Manager configured for platform! You must configure it.
 	#endif
-	
+
 	return mgr;
 }
 
@@ -783,7 +781,7 @@
 XMLAtomicOpMgr* XMLPlatformUtils::makeAtomicOpMgr(MemoryManager* const memmgr)
 {
 	XMLAtomicOpMgr* mgr = NULL;
-	
+
 	#if XERCES_USE_ATOMICOPMGR_NOTHREAD
 		mgr = new (memmgr) NoThreadAtomicOpMgr;
 	#elif XERCES_USE_ATOMICOPMGR_POSIX
@@ -795,7 +793,7 @@
 	#else
 		#error No AtomicOp Manager configured for platform! You must configure it.
 	#endif
-	
+
 	return mgr;
 }
 
@@ -900,12 +898,12 @@
  *
  *  Previously, each <OS>PlatformUtils.cpp has its onw copy of the
  *  method weavePaths(), and almost of them implemented the same logic,
- *  with few platform specific difference, and unfortunately that 
+ *  with few platform specific difference, and unfortunately that
  *  implementation was wrong.
- *  
+ *
  *  The only platform specific issue is slash character.
- *  On all platforms other than Windows, chForwardSlash and chBackSlash 
- *  are considered slash, while on Windows, two additional characters, 
+ *  On all platforms other than Windows, chForwardSlash and chBackSlash
+ *  are considered slash, while on Windows, two additional characters,
  *  chYenSign and chWonSign are slash as well.
  *
  *  The idea is to maintain a SINGLE copy of this method rather than
@@ -913,17 +911,17 @@
  *  method, XMLPlatformUtils::isAnySlash(), to replace the direct checking
  *  code ( if ( c == chForwardSlash || c == chBackSlash).
  *
- *  With this approach, we might have a performance hit since isAnySlash() 
- *  is so frequently used in this implementation, so we intend to make it 
+ *  With this approach, we might have a performance hit since isAnySlash()
+ *  is so frequently used in this implementation, so we intend to make it
  *  inline. Then we face a complier issue.
  *
- *  There are two compilation units involved, one is PlatformUtils.cpp and 
+ *  There are two compilation units involved, one is PlatformUtils.cpp and
  *  the other <OS>PlatformUtils.cpp. When PlatformUtils.cp get compiled,
  *  the weavePath(), remove**Slash() have dependency upon isAnySlash() which
  *  is in <OS>PlatformUtils.cpp (and what is worse, it is inlined), so we have
- *  undefined/unresolved symbol: isAnySlash() on AIX/xlc_r, Solaris/cc and 
+ *  undefined/unresolved symbol: isAnySlash() on AIX/xlc_r, Solaris/cc and
  *  Linux/gcc, while MSVC and HP/aCC are fine with this.
- *  
+ *
  *  That means we can not place these new methods in PlatformUtils.cpp with
  *  inlined XMLPlatformUtils::isAnySlash() in <OS>PlatformUtils.cpp.
  *
@@ -974,7 +972,7 @@
     // 1. concatenate the base and relative
     // 2. remove all occurences of "/./"
     // 3. remove all occurences of segment/../ where segment is not ../
-	// 
+	//
 
     XMLString::subString(tmpBuf, basePath, 0, (basePtr - basePath + 1), manager);
     tmpBuf[basePtr - basePath + 1] = 0;
@@ -1003,7 +1001,7 @@
 
     XMLCh* srcPtr = XMLString::replicate(path, manager);
     XMLSize_t srcLen = XMLString::stringLen(srcPtr);
-    ArrayJanitor<XMLCh>   janName(srcPtr, manager);   
+    ArrayJanitor<XMLCh>   janName(srcPtr, manager);
     XMLCh* tarPtr = path;
 
     while (*srcPtr)
@@ -1017,7 +1015,7 @@
                 // "\.\x" seen
                 // skip the first two, and start from the 3rd,
                 // since "\x" could be another "\."
-                srcPtr+=2;              
+                srcPtr+=2;
                 srcLen-=2;
             }
             else
@@ -1135,7 +1133,7 @@
                 srcLen--;
             }
         }
-        else 
+        else
         {
             break;
         }



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


RE: svn commit: r630254 - in /xerces/c/trunk: configure.ac m4/xerces_msgloader_selection.m4 m4/xerces_netaccessor_selection.m4 src/xercesc/util/PlatformUtils.cpp

Posted by Scott Cantor <ca...@osu.edu>.
> On Mac OS X, libcurl is present in the base system going back 2-3
> major releases, so in this case no "extra" dependencies are dragged in.

If you're taking votes (not that you are), +1 for libcurl on OS X. If for no
other reason than it will ensure that the libcurl option gets sufficient
testing and maintenance, which I see as a real problem for a lot of these
options that people don't seem to use as much.

-- Scott



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


Re: svn commit: r630254 - in /xerces/c/trunk: configure.ac m4/xerces_msgloader_selection.m4 m4/xerces_netaccessor_selection.m4 src/xercesc/util/PlatformUtils.cpp

Posted by James Berry <jb...@apache.org>.
Boris,

Thanks for your feedback. My primary purpose was to make sure that you  
made this choice with a purpose.

More...

On Feb 25, 2008, at 1:27 PM, Boris Kolpackov wrote:

> Hi James,
>
> James Berry <jb...@apache.org> writes:
>
>> With this change you've made Mac prefer using a sockets based
>> netaccessor over either curl or the macosnative netaccessor, either  
>> of
>> which I'd think is more functional than sockets.
>
> Thanks for reviewing the changes. The idea of by default preferring
> socket net accessor over curl on all platforms is that we don't want
> to silently introduce extra dependencies for Xerces-C++ library just
> because the user happened to have libcurl installed. Users who want
> extra functionality of curl can always request it explicitly.

To me, the big difference between socket and curl is that curl should  
give https support out of the box, while socket won't. I'm not sure  
how big a deal this is to our common user.

On Mac OS X, libcurl is present in the base system going back 2-3  
major releases, so in this case no "extra" dependencies are dragged in.

> Now as for why not preferring cfurl over socket on OS X (with
> neither adding any extra dependencies, ASAIK), is that I got an
> impression that the OS X-specific APIs that are used are deprecated
> and/or not safe in certain circumstances (see, for example, the
> recent "Xerces crashes after fork on OS X 10.5" thread on c-dev).
> I am by no means a Mac OS X expert but I think it makes sense to
> move away from OS X-specific APIs to POSIX unless there are
> significant advantages in using these APIs. Are there any such
> advantages?

For those reasons, indeed, I definitely prefer the curl netaccessor on  
Mac OS X (which had higher priority than cfurl before your change, and  
still does now) rather than cfurl (which may still have a use on older  
systems where curl is not present).

Okay: given that background, I'm fine with whatever you decide. I  
think it comes down to a question of whether the default build should  
have support for https, ftp, etc, when it's easy to do so. Your reason  
for not having it seems to be that, well, some systems won't have it.  
A lowest-common-denominator approach?

Thanks for all your effort to (finally, hopefully) get 3.0 out the  
door. I feel bad that I didn't have the stamina to do so 3 or so years  
ago!

James


>
>
> Thanks,
> Boris
>
> -- 
> Boris Kolpackov, Code Synthesis Tools
> Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
> Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde


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


Re: svn commit: r630254 - in /xerces/c/trunk: configure.ac m4/xerces_msgloader_selection.m4 m4/xerces_netaccessor_selection.m4 src/xercesc/util/PlatformUtils.cpp

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi James,

James Berry <jb...@apache.org> writes:

> With this change you've made Mac prefer using a sockets based
> netaccessor over either curl or the macosnative netaccessor, either of
> which I'd think is more functional than sockets.

Thanks for reviewing the changes. The idea of by default preferring
socket net accessor over curl on all platforms is that we don't want
to silently introduce extra dependencies for Xerces-C++ library just
because the user happened to have libcurl installed. Users who want
extra functionality of curl can always request it explicitly.

Now as for why not preferring cfurl over socket on OS X (with
neither adding any extra dependencies, ASAIK), is that I got an
impression that the OS X-specific APIs that are used are deprecated
and/or not safe in certain circumstances (see, for example, the
recent "Xerces crashes after fork on OS X 10.5" thread on c-dev).
I am by no means a Mac OS X expert but I think it makes sense to
move away from OS X-specific APIs to POSIX unless there are
significant advantages in using these APIs. Are there any such
advantages?

Thanks,
Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

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