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 2005/05/31 18:10:55 UTC

svn commit: r179231 - /xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp

Author: amassari
Date: Tue May 31 09:10:54 2005
New Revision: 179231

URL: http://svn.apache.org/viewcvs?rev=179231&view=rev
Log:
- Hook winsock netaccessor
- Use ftime from sys/timeb.h before trying to use gettimeofday from sys/time.h (Mingw doesn't have a gettimeofday inside time.h)

Modified:
    xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp

Modified: xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp?rev=179231&r1=179230&r2=179231&view=diff
==============================================================================
--- xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp (original)
+++ xerces/c/branches/jberry/3.0-unstable/src/xercesc/util/PlatformUtils.cpp Tue May 31 09:10:54 2005
@@ -85,6 +85,10 @@
 #if XERCES_USE_NETACCESSOR_CFURL
 #	include <xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.hpp>
 #endif
+#if XERCES_USE_NETACCESSOR_WINSOCK
+#	include <xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.hpp>
+#endif
+
 
 #include <xercesc/util/XMLMsgLoader.hpp>
 #if XERCES_USE_MSGLOADER_ICU
@@ -382,6 +386,8 @@
 		na = new LibWWWNetAccessor();
 	#elif defined (XERCES_USE_NETACCESSOR_CFURL)
 		na = new MacOSURLAccessCF();
+    #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
@@ -639,14 +645,14 @@
 	unsigned long ms = 0;
 	
 	// *** TODO: additional platform support?
-	#if   HAVE_SYS_TIME_H
-		struct timeval aTime;
-		gettimeofday(&aTime, NULL);
-		ms = (unsigned long) (aTime.tv_sec * 1000 + aTime.tv_usec / 1000);
-	#elif HAVE_SYS_TIMEB_H
+	#if HAVE_SYS_TIMEB_H
 		timeb aTime;
 		ftime(&aTime);
 		ms = (unsigned long)(aTime.time*1000 + aTime.millitm);
+	#elif   HAVE_SYS_TIME_H
+		struct timeval aTime;
+		gettimeofday(&aTime, NULL);
+		ms = (unsigned long) (aTime.tv_sec * 1000 + aTime.tv_usec / 1000);
 	#else
 		// Make this a warning instead?
 		#error No timing support is configured for this platform. You must configure it.



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