|
From: <sag...@us...> - 2011-06-08 22:16:05
|
Revision: 895
http://modplug.svn.sourceforge.net/modplug/?rev=895&view=rev
Author: saga-games
Date: 2011-06-08 22:15:59 +0000 (Wed, 08 Jun 2011)
Log Message:
-----------
[Mod] Returning to _mkgmtime, since the new code doesn't seem to play well with DST settings (using it only in VS2003 now, where it is required because _mkgmtime is not defined)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/misc_util.cpp
Modified: trunk/OpenMPT/mptrack/misc_util.cpp
===================================================================
--- trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-07 17:17:49 UTC (rev 894)
+++ trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-08 22:15:59 UTC (rev 895)
@@ -62,11 +62,14 @@
time_t Util::sdTime::MakeGmTime(tm& timeUtc)
{
+#if MSVC_VER_2003
+ // VC++ 2003 doesn't have _mkgmtime
+ // This does not seem to work properly with DST time zones sometimes - if that's of any concern for you, please upgrade your compiler :)
TIME_ZONE_INFORMATION tzi;
GetTimeZoneInformation(&tzi);
- const time_t timeUtcTimeT = mktime(&timeUtc) - 60 * tzi.Bias;
-#if (_MSC_VER >= MSVC_VER_2005) && defined(_DEBUG)
- ASSERT(timeUtcTimeT < 0 || timeUtcTimeT == _mkgmtime(&timeUtc));
+ const time_t timeUtcTimeT = mktime(&timeUtc) - tzi.Bias * 60;
+#else
+ const time_t timeUtcTimeT = _mkgmtime(&timeUtc);
#endif
return timeUtcTimeT;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|