3rd time the charm? Fixes #2990, maybe cpw.khc.msnp14

Wed, 12 Sep 2007 05:36:59 +0000

author
Ka-Hing Cheung <khc@pidgin.im>
date
Wed, 12 Sep 2007 05:36:59 +0000
branch
cpw.khc.msnp14
changeset 20587
55af483c9e86
parent 20586
928a73117b1c
child 20588
f1d08129f4f1

3rd time the charm? Fixes #2990, maybe

libpurple/protocols/msn/oim.c file | annotate | diff | comparison | revisions
libpurple/util.c file | annotate | diff | comparison | revisions
libpurple/win32/win32dep.c file | annotate | diff | comparison | revisions
libpurple/win32/win32dep.h file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/oim.c	Wed Sep 12 02:40:56 2007 +0000
+++ b/libpurple/protocols/msn/oim.c	Wed Sep 12 05:36:59 2007 +0000
@@ -467,7 +467,7 @@
 				t.tm_isdst = 0;
 
 #ifdef _WIN32
-				if ((sys_tzoff = win32_get_tz_offset()) != -1)
+				if ((sys_tzoff = wpurple_get_tz_offset()) != -1)
 					tzoff += sys_tzoff;
 #else
 #ifdef HAVE_TM_GMTOFF
--- a/libpurple/util.c	Wed Sep 12 02:40:56 2007 +0000
+++ b/libpurple/util.c	Wed Sep 12 05:36:59 2007 +0000
@@ -514,23 +514,6 @@
  * Date/Time Functions
  **************************************************************************/
 
-#ifdef _WIN32
-static long win32_get_tz_offset() {
-	TIME_ZONE_INFORMATION tzi;
-	DWORD ret;
-	long off = -1;
-
-	if ((ret = GetTimeZoneInformation(&tzi)) != TIME_ZONE_ID_INVALID)
-	{
-		off = -(tzi.Bias * 60);
-		if (ret == TIME_ZONE_ID_DAYLIGHT)
-			off -= tzi.DaylightBias * 60;
-	}
-
-	return off;
-}
-#endif
-
 const char *purple_get_tzoff_str(const struct tm *tm, gboolean iso)
 {
 	static char buf[7];
@@ -545,7 +528,7 @@
 		g_return_val_if_reached("");
 
 #ifdef _WIN32
-	if ((off = win32_get_tz_offset()) == -1)
+	if ((off = wpurple_get_tz_offset()) == -1)
 		return "";
 #else
 # ifdef HAVE_TM_GMTOFF
@@ -853,7 +836,7 @@
 #endif
 
 #ifdef _WIN32
-				if ((sys_tzoff = win32_get_tz_offset()) == -1)
+				if ((sys_tzoff = wpurple_get_tz_offset()) == -1)
 					tzoff = PURPLE_NO_TZ_OFF;
 				else
 					tzoff += sys_tzoff;
--- a/libpurple/win32/win32dep.c	Wed Sep 12 02:40:56 2007 +0000
+++ b/libpurple/win32/win32dep.c	Wed Sep 12 05:36:59 2007 +0000
@@ -586,6 +586,22 @@
 	libpurpledll_hInstance = NULL;
 }
 
+long
+wpurple_get_tz_offset() {
+	TIME_ZONE_INFORMATION tzi;
+	DWORD ret;
+	long off = -1;
+
+	if ((ret = GetTimeZoneInformation(&tzi)) != TIME_ZONE_ID_INVALID)
+	{
+		off = -(tzi.Bias * 60);
+		if (ret == TIME_ZONE_ID_DAYLIGHT)
+			off -= tzi.DaylightBias * 60;
+	}
+
+	return off;
+}
+
 /* DLL initializer */
 /* suppress gcc "no previous prototype" warning */
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
--- a/libpurple/win32/win32dep.h	Wed Sep 12 02:40:56 2007 +0000
+++ b/libpurple/win32/win32dep.h	Wed Sep 12 05:36:59 2007 +0000
@@ -60,6 +60,7 @@
 void wpurple_init(void);
 void wpurple_cleanup(void);
 
+long wpurple_get_tz_offset(void);
 
 /*
  *  MACROS

mercurial