| 9 |
|
#include <time.h> |
| 10 |
|
#include <stdlib.h> |
| 11 |
|
|
| 12 |
< |
#ifdef _WIN32 |
| 13 |
< |
char * |
| 12 |
> |
extern time_t timegm(struct tm *tm); |
| 13 |
> |
|
| 14 |
> |
#if defined(_WIN32) || defined(_WIN64) |
| 15 |
> |
static char * |
| 16 |
|
setGMT() |
| 17 |
|
{ |
| 18 |
|
static time_t prevTZ; |
| 20 |
|
_timezone = 0; |
| 21 |
|
return (char *)&prevTZ; |
| 22 |
|
} |
| 23 |
< |
void |
| 23 |
> |
static void |
| 24 |
|
resetTZ(char *cp) |
| 25 |
|
{ |
| 26 |
|
_timezone = *(time_t *)cp; |
| 27 |
|
} |
| 28 |
|
#else |
| 29 |
< |
char * |
| 29 |
> |
static char * |
| 30 |
|
setGMT() |
| 31 |
|
{ |
| 32 |
|
char *tz = getenv("TZ"); |
| 34 |
|
tzset(); |
| 35 |
|
return tz; |
| 36 |
|
} |
| 37 |
< |
void |
| 37 |
> |
static void |
| 38 |
|
resetTZ(char *tz) |
| 39 |
|
{ |
| 40 |
|
if (tz) |