mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-22 17:22:18 -05:00
Fixed get_timezone() to work on windows.
This commit is contained in:
parent
9a789bc9e7
commit
4b40597c76
@ -1337,8 +1337,16 @@ get_timezone(void)
|
||||
|
||||
time (&t);
|
||||
|
||||
/* gmtime() and localtime() are thread-safe on windows.
|
||||
* on other systems we should use {gmtime,localtime}_r().
|
||||
*/
|
||||
#if WIN32
|
||||
tm_utc = *gmtime (&t);
|
||||
tm_local = *localtime (&t);
|
||||
#else
|
||||
gmtime_r (&t, &tm_utc);
|
||||
localtime_r (&t, &tm_local);
|
||||
#endif
|
||||
|
||||
time_utc = mktime (&tm_utc);
|
||||
time_local = mktime (&tm_local);
|
||||
|
Loading…
Reference in New Issue
Block a user