From dd90d5f61610a7bd59fe3f778d07000cc9746516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 10 Nov 2005 15:59:32 +0000 Subject: *BUGFIX* Cygwin port update. CVS patchset: 7798 CVS date: 2005/11/10 15:59:32 --- configure.ac | 2 +- lib/gmtime.c | 17 +++++++++++++++++ lib/os_internal.h | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 lib/gmtime.c diff --git a/configure.ac b/configure.ac index 8bb762679..c82a7db81 100644 --- a/configure.ac +++ b/configure.ac @@ -1815,7 +1815,7 @@ AC_CHECK_FUNCS([vsscanf sigaction sigset getpwuid_r nanosleep lstat memset strch AC_FUNC_FSEEKO AC_DEFINE(_GNU_SOURCE) AC_CHECK_HEADERS(byteswap.h malloc.h execinfo.h ucontext.h sys/mman.h sys/mixer.h libgen.h netdb.h dirent.h sys/times.h sys/ioctl.h sys/param.h) -AC_REPLACE_FUNCS(basename gettimeofday setenv strndup strpbrk strsep strtok_r) +AC_REPLACE_FUNCS(basename gettimeofday gmtime setenv strndup strpbrk strsep strtok_r) AC_CHECK_FUNCS(readlink) AC_LIBSOURCE(hstrerror.c) 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 +#include + +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 +#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 -- cgit v1.2.3