aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/c.h6
-rw-r--r--src/include/port.h36
-rw-r--r--src/interfaces/ecpg/compatlib/Makefile5
-rw-r--r--src/interfaces/ecpg/ecpglib/Makefile5
-rw-r--r--src/interfaces/ecpg/pgtypeslib/Makefile7
-rw-r--r--src/interfaces/ecpg/preproc/Makefile5
-rw-r--r--src/interfaces/ecpg/test/Makefile5
-rw-r--r--src/timezone/README2
8 files changed, 58 insertions, 13 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 325cfc217d0..6d7f852ed5f 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.160 2004/03/10 21:12:46 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.161 2004/04/30 04:14:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -310,12 +310,16 @@ typedef unsigned long int uint64;
#endif
/* Global variable holding time zone information. */
+#ifdef USE_PGTZ
+#define TIMEZONE_GLOBAL pg_timezone
+#else
#ifndef HAVE_UNDERSCORE_TIMEZONE
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endif
+#endif
/* sig_atomic_t is required by ANSI C, but may be missing on old platforms */
#ifndef HAVE_SIG_ATOMIC_T
diff --git a/src/include/port.h b/src/include/port.h
index 93b549503fd..f6d37d3bed1 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.25 2004/04/19 17:42:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.26 2004/04/30 04:14:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -177,3 +177,37 @@ extern int pqGethostbyname(const char *name,
#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
#define WTERMSIG(w) ((w) & 0x7f)
#endif
+
+/*
+ * Internal timezone library
+ */
+#ifdef USE_PGTZ
+#ifndef FRONTEND
+#undef localtime
+#undef gmtime
+#undef asctime
+#undef ctime
+#undef difftime
+#undef mktime
+#undef tzset
+
+#define localtime(timep) pg_localtime(timep)
+#define gmtime(timep) pg_gmtime(timep)
+#define asctime(timep) pg_asctime(timep)
+#define ctime(timep) pg_ctime(timep)
+#define difftime(t1,t2) pg_difftime(t1,t2)
+#define mktime(tm) pg_mktime(tm)
+#define tzset pg_tzset
+
+
+extern struct tm *pg_localtime(const time_t *);
+extern struct tm *gg_gmtime(const time_t *);
+extern char *pg_asctime(const struct tm *);
+extern char *pg_ctime(const time_t *);
+extern double pg_difftime(const time_t, const time_t);
+extern time_t pg_mktime(struct tm *);
+extern void pg_tzset(void);
+extern time_t pg_timezone;
+
+#endif
+#endif
diff --git a/src/interfaces/ecpg/compatlib/Makefile b/src/interfaces/ecpg/compatlib/Makefile
index 18ab49d2590..c490e1a2a7b 100644
--- a/src/interfaces/ecpg/compatlib/Makefile
+++ b/src/interfaces/ecpg/compatlib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.16 2004/04/25 20:57:32 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.17 2004/04/30 04:14:05 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,8 @@ NAME= ecpg_compat
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 1
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \
+ -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile
index 4596158db95..d9fb7679211 100644
--- a/src/interfaces/ecpg/ecpglib/Makefile
+++ b/src/interfaces/ecpg/ecpglib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.16 2004/04/25 20:57:32 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.17 2004/04/30 04:14:05 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,8 @@ NAME= ecpg
SO_MAJOR_VERSION= 4
SO_MINOR_VERSION= 2
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include \
+ -I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile
index c6a365a0247..6e0692ef7ec 100644
--- a/src/interfaces/ecpg/pgtypeslib/Makefile
+++ b/src/interfaces/ecpg/pgtypeslib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.17 2004/04/23 18:15:54 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.18 2004/04/30 04:14:06 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,10 @@ NAME= pgtypes
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 2
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) $(PTHREAD_CFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include \
+ -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) \
+ $(PTHREAD_CFLAGS) -DFRONTEND
+
SHLIB_LINK += -lm
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index d5298651677..d57fffb7881 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.102 2004/04/26 17:40:48 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.103 2004/04/30 04:14:06 momjian Exp $
subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../..
@@ -12,7 +12,8 @@ override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
-DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
-DINCLUDEDIR=\"$(includedir)\" \
- -DPKGINCLUDEDIR=\"$(pkgincludedir)\"
+ -DPKGINCLUDEDIR=\"$(pkgincludedir)\" \
+ -DFRONTEND
ifeq ($(GCC), yes)
override CFLAGS += -Wno-error
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index 92a3eb7e882..f50445c6d71 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.46 2004/04/25 20:57:32 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.47 2004/04/30 04:14:06 momjian Exp $
subdir = src/interfaces/ecpg/test
top_builddir = ../../../..
@@ -9,7 +9,8 @@ override CFLAGS += $(PTHREAD_CFLAGS)
ECPG = ../preproc/ecpg -I$(srcdir)/../include
-TESTS = test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init testdynalloc num_test dt_test test_informix
+TESTS = test1 test2 test3 test4 perftest dyntest dyntest2 test_notice \
+ test_code100 test_init testdynalloc num_test dt_test test_informix
ifeq ($(enable_thread_safety), yes)
TESTS += test_thread test_thread_implicit
endif
diff --git a/src/timezone/README b/src/timezone/README
index 79b6ee7d972..bfea93f1bb4 100644
--- a/src/timezone/README
+++ b/src/timezone/README
@@ -1,7 +1,7 @@
This is a PostgreSQL adapted version of the timezone library
from:
-ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
+ ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
The interface is used when USE_PGTZ is defined at the top level. This
will cause the following functions to be redefined: