X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61bfe4b0caa43a95a181baa30d3f6b06778b1d18..304b8bc189e7d1d51cf8012aa9708fced31b987e:/src/msw/ole/automtn.cpp

diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp
index 4b2b77b108..f80d6d8216 100644
--- a/src/msw/ole/automtn.cpp
+++ b/src/msw/ole/automtn.cpp
@@ -9,7 +9,7 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "automtn.h"
 #endif
 
@@ -28,18 +28,28 @@
 
 #define _FORCENAMELESSUNION
 #include "wx/log.h"
+#include "wx/msw/private.h"
 #include "wx/msw/ole/oleutils.h"
 #include "wx/msw/ole/automtn.h"
-#include "wx/msw/private.h"
 
 #include <math.h>
+
+#ifdef __WXWINCE__
+#include "wx/msw/wince/time.h"
+#else
 #include <time.h>
+#endif
 
 #include <wtypes.h>
 #include <unknwn.h>
+
 #include <ole2.h>
 #define _huge
+
+#ifndef __WXWINCE__
 #include <ole2ver.h>
+#endif
+
 #include <oleauto.h>
 
 // Verifies will fail if the needed buffer size is too large
@@ -939,7 +949,6 @@ BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest)
 	if (dtSrc > MAX_DATE || dtSrc < MIN_DATE) // about year 100 to about 9999
 		return FALSE;
 
-	long nDays;             // Number of days since Dec. 30, 1899
 	long nDaysAbsolute;     // Number of days since 1/1/0
 	long nSecsInDay;        // Time in seconds since midnight
 	long nMinutesInDay;     // Minutes in day
@@ -954,9 +963,6 @@ BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest)
 
 	double dblDate = dtSrc; // tempory serial date
 
-	// If a valid date, then this conversion should not overflow
-	nDays = (long)dblDate;
-
 	// Round to the second
 	dblDate += ((dtSrc > 0.0) ? HALF_SECOND : -HALF_SECOND);
 
@@ -1043,7 +1049,8 @@ BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest)
 
 	// Month number always >= n/32, so save some loop time */
 	for (tmDest.tm_mon = (n4Day >> 5) + 1;
-		n4Day > rgMonthDays[tmDest.tm_mon]; tmDest.tm_mon++);
+		n4Day > rgMonthDays[tmDest.tm_mon]; tmDest.tm_mon++)
+	        ;
 
 	tmDest.tm_mday = (int)(n4Day - rgMonthDays[tmDest.tm_mon-1]);