From 678b4e9cad47a6c176bb05de32aa0dd56742f15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 14 Nov 2005 12:34:45 +0000 Subject: *BUGFIX* Testsuite for M$ Windows: - init mutex in all video drivers ('none' for testsuite, fixes crashes), was OK for linux pthreads - use WaitForSingleObject for console file descriptirs in _x_io_select (fixes stdin:/) - workaround heavy debug messages in asf demuxer for some samples (fixes full disk :->) Fixed previous fix, s/gmtime/timgm/ :-) Aalib cross detection + udate docs CVS patchset: 7799 CVS date: 2005/11/14 12:34:45 --- lib/gmtime.c | 17 ----------------- lib/os_internal.h | 14 ++++++++++---- lib/timegm.c | 19 +++++++++++++++++++ lib/unsetenv.c | 7 +++++++ 4 files changed, 36 insertions(+), 21 deletions(-) delete mode 100644 lib/gmtime.c create mode 100644 lib/timegm.c create mode 100644 lib/unsetenv.c (limited to 'lib') diff --git a/lib/gmtime.c b/lib/gmtime.c deleted file mode 100644 index b6fdd9e4c..000000000 --- a/lib/gmtime.c +++ /dev/null @@ -1,17 +0,0 @@ -#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 6d5d33ae4..f7365381f 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -84,11 +84,17 @@ 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 +/* replacement of timegm */ +#ifndef HAVE_TIMEGM #include -#define gmtime(TM) _xine_private_gmtime((TM)) -time_t _xine_private_gmtime(struct tm *tm); +#define timegm(TM) _xine_private_timegm((TM)) +time_t _xine_private_timegm(struct tm *tm); +#endif + +/* replacement of unsetenv */ +#ifndef HAVE_UNSETENV +#define unsetenv(NAME) _xine_private_unsetenv((NAME)) +void _xine_private_unsetenv(const char *name); #endif /* macross needed for MSVC */ diff --git a/lib/timegm.c b/lib/timegm.c new file mode 100644 index 000000000..182a1b527 --- /dev/null +++ b/lib/timegm.c @@ -0,0 +1,19 @@ +#include "config.h" + +#include +#include + +time_t _xine_private_timegm(struct tm *tm) { + time_t ret; + char *tz; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzset(); + ret = mktime(tm); + if (tz) setenv("TZ", tz, 1); + else unsetenv("TZ"); + tzset(); + + return ret; +} diff --git a/lib/unsetenv.c b/lib/unsetenv.c new file mode 100644 index 000000000..76ba332e3 --- /dev/null +++ b/lib/unsetenv.c @@ -0,0 +1,7 @@ +#include "config.h" + +#include + +void _xine_private_unsetenv(const char *name) { + putenv(name); +} -- cgit v1.2.3