From d248a67af1d849438e146bccd46adb1eb0a9f3b5 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 30 Apr 2004 04:11:58 +0000 Subject: [PATCH] Timezone library changes to map into our backend code. --- src/timezone/asctime.c | 1 + src/timezone/difftime.c | 1 + src/timezone/localtime.c | 5 +++++ src/timezone/zic.c | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/src/timezone/asctime.c b/src/timezone/asctime.c index 7054c75458..31a6275edc 100644 --- a/src/timezone/asctime.c +++ b/src/timezone/asctime.c @@ -1,3 +1,4 @@ +#include "pgtz.h" /* ** This file is in the public domain, so clarified as of ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). diff --git a/src/timezone/difftime.c b/src/timezone/difftime.c index a4aa631d15..636640d6f5 100644 --- a/src/timezone/difftime.c +++ b/src/timezone/difftime.c @@ -1,3 +1,4 @@ +#include "pgtz.h" /* ** This file is in the public domain, so clarified as of ** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov). diff --git a/src/timezone/localtime.c b/src/timezone/localtime.c index 33e22a5e20..4f389b52de 100644 --- a/src/timezone/localtime.c +++ b/src/timezone/localtime.c @@ -1,3 +1,8 @@ +#include "pgtz.h" +#undef open +#define timezone pg_timezone +#define USG_COMPAT +extern time_t pg_timezone; /* ** This file is in the public domain, so clarified as of ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). diff --git a/src/timezone/zic.c b/src/timezone/zic.c index f4eaa0ca05..ec187addf3 100644 --- a/src/timezone/zic.c +++ b/src/timezone/zic.c @@ -1,4 +1,11 @@ static char elsieid[] = "@(#)zic.c 7.115"; +#include "pgtz.h" +#undef unlink +#undef TZDIR +#define TZDIR "data" +#ifdef WIN32 +#include +#endif #include "private.h" #include "locale.h" @@ -7,11 +14,13 @@ static char elsieid[] = "@(#)zic.c 7.115"; #if HAVE_SYS_STAT_H #include "sys/stat.h" #endif +#ifndef WIN32 #ifdef S_IRUSR #define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) #else #define MKDIR_UMASK 0755 #endif +#endif /* ** On some ancient hosts, predicates like `isspace(C)' are defined @@ -2234,3 +2243,16 @@ const int i; /* ** UNIX was a registered trademark of The Open Group in 2003. */ + + +#ifdef WIN32 +/* + * To run on win32 + */ +int link(const char *oldpath, const char *newpath) { + if (!CopyFileEx(oldpath, newpath, NULL, NULL, FALSE, 0)) { + return -1; + } + return 0; +} +#endif -- 2.40.0