summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/os_internal.h14
-rw-r--r--lib/timegm.c (renamed from lib/gmtime.c)6
-rw-r--r--lib/unsetenv.c7
3 files changed, 21 insertions, 6 deletions
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 <time.h>
-#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/gmtime.c b/lib/timegm.c
index b6fdd9e4c..182a1b527 100644
--- a/lib/gmtime.c
+++ b/lib/timegm.c
@@ -1,13 +1,15 @@
+#include "config.h"
+
#include <time.h>
#include <stdlib.h>
-time_t _xine_private_gmtime(struct tm *tm) {
+time_t _xine_private_timegm(struct tm *tm) {
time_t ret;
char *tz;
tz = getenv("TZ");
setenv("TZ", "", 1);
- tzet();
+ tzset();
ret = mktime(tm);
if (tz) setenv("TZ", tz, 1);
else unsetenv("TZ");
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 <stdlib.h>
+
+void _xine_private_unsetenv(const char *name) {
+ putenv(name);
+}