diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2005-11-10 15:59:32 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2005-11-10 15:59:32 +0000 |
commit | dd90d5f61610a7bd59fe3f778d07000cc9746516 (patch) | |
tree | f661b97e48e0cf51e30deebf1948bea8a9c9f9fa /lib | |
parent | 3c2de6e117f10e76720765001f9377f1625faf76 (diff) | |
download | xine-lib-dd90d5f61610a7bd59fe3f778d07000cc9746516.tar.gz xine-lib-dd90d5f61610a7bd59fe3f778d07000cc9746516.tar.bz2 |
*BUGFIX*
Cygwin port update.
CVS patchset: 7798
CVS date: 2005/11/10 15:59:32
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gmtime.c | 17 | ||||
-rw-r--r-- | lib/os_internal.h | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/gmtime.c b/lib/gmtime.c new file mode 100644 index 000000000..b6fdd9e4c --- /dev/null +++ b/lib/gmtime.c @@ -0,0 +1,17 @@ +#include <time.h> +#include <stdlib.h> + +time_t _xine_private_gmtime(struct tm *tm) { + time_t ret; + char *tz; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzet(); + ret = mktime(tm); + if (tz) setenv("TZ", tz, 1); + else unsetenv("TZ"); + tzset(); + + return ret; +} diff --git a/lib/os_internal.h b/lib/os_internal.h index 2f73c8a2b..6d5d33ae4 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -84,6 +84,13 @@ char *_xine_private_strpbrk(const char *s, const char *accept); char *_xine_private_strsep(char **stringp, const char *delim); #endif +/* replacement of gmtime */ +#ifndef HAVE_GMTIME +#include <time.h> +#define gmtime(TM) _xine_private_gmtime((TM)) +time_t _xine_private_gmtime(struct tm *tm); +#endif + /* macross needed for MSVC */ #ifdef _MSC_VER # define snprintf _snprintf |