Mercurial > pidgin
changeset 20503:905891855710
3rd time the charm? Fixes #2990, maybe
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Wed, 12 Sep 2007 05:36:59 +0000 |
parents | b5a2938b4549 |
children | 909af554e239 |
files | libpurple/protocols/msn/oim.c libpurple/util.c libpurple/win32/win32dep.c libpurple/win32/win32dep.h |
diffstat | 4 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- 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);