Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a73eb5

Browse files
committed
Minor adjustments to enable public-domain timezone library to be called
from our code.
1 parentd248a67 commit4a73eb5

File tree

8 files changed

+58
-13
lines changed

8 files changed

+58
-13
lines changed

‎src/include/c.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/include/c.h,v 1.160 2004/03/10 21:12:46 momjian Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.161 2004/04/30 04:14:05 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -310,12 +310,16 @@ typedef unsigned long int uint64;
310310
#endif
311311

312312
/* Global variable holding time zone information. */
313+
#ifdefUSE_PGTZ
314+
#defineTIMEZONE_GLOBAL pg_timezone
315+
#else
313316
#ifndefHAVE_UNDERSCORE_TIMEZONE
314317
#defineTIMEZONE_GLOBAL timezone
315318
#else
316319
#defineTIMEZONE_GLOBAL _timezone
317320
#definetzname _tzname/* should be in time.h? */
318321
#endif
322+
#endif
319323

320324
/* sig_atomic_t is required by ANSI C, but may be missing on old platforms */
321325
#ifndefHAVE_SIG_ATOMIC_T

‎src/include/port.h

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.25 2004/04/19 17:42:59 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.26 2004/04/30 04:14:05 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -177,3 +177,37 @@ extern int pqGethostbyname(const char *name,
177177
#defineWIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
178178
#defineWTERMSIG(w) ((w) & 0x7f)
179179
#endif
180+
181+
/*
182+
* Internal timezone library
183+
*/
184+
#ifdefUSE_PGTZ
185+
#ifndefFRONTEND
186+
#undef localtime
187+
#undef gmtime
188+
#undef asctime
189+
#undef ctime
190+
#undef difftime
191+
#undef mktime
192+
#undef tzset
193+
194+
#definelocaltime(timep) pg_localtime(timep)
195+
#definegmtime(timep) pg_gmtime(timep)
196+
#defineasctime(timep) pg_asctime(timep)
197+
#definectime(timep) pg_ctime(timep)
198+
#definedifftime(t1,t2) pg_difftime(t1,t2)
199+
#definemktime(tm) pg_mktime(tm)
200+
#definetzset pg_tzset
201+
202+
203+
externstructtm*pg_localtime(consttime_t*);
204+
externstructtm*gg_gmtime(consttime_t*);
205+
externchar*pg_asctime(conststructtm*);
206+
externchar*pg_ctime(consttime_t*);
207+
externdoublepg_difftime(consttime_t,consttime_t);
208+
externtime_tpg_mktime(structtm*);
209+
externvoidpg_tzset(void);
210+
externtime_tpg_timezone;
211+
212+
#endif
213+
#endif

‎src/interfaces/ecpg/compatlib/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.16 2004/04/25 20:57:32 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.17 2004/04/30 04:14:05 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -16,7 +16,8 @@ NAME= ecpg_compat
1616
SO_MAJOR_VERSION= 1
1717
SO_MINOR_VERSION= 1
1818

19-
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils$(CPPFLAGS)
19+
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir)\
20+
-I$(top_srcdir)/src/include/utils$(CPPFLAGS)
2021
overrideCFLAGS +=$(PTHREAD_CFLAGS)
2122
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes$(libpq)\
2223
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm,$(LIBS))$(PTHREAD_LIBS)

‎src/interfaces/ecpg/ecpglib/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.16 2004/04/25 20:57:32 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.17 2004/04/30 04:14:05 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -16,7 +16,8 @@ NAME= ecpg
1616
SO_MAJOR_VERSION= 4
1717
SO_MINOR_VERSION= 2
1818

19-
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir)$(CPPFLAGS)
19+
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include\
20+
-I$(libpq_srcdir)$(CPPFLAGS)
2021
overrideCFLAGS +=$(PTHREAD_CFLAGS)
2122

2223
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o\

‎src/interfaces/ecpg/pgtypeslib/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.17 2004/04/23 18:15:54 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.18 2004/04/30 04:14:06 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -16,7 +16,10 @@ NAME= pgtypes
1616
SO_MAJOR_VERSION= 1
1717
SO_MINOR_VERSION= 2
1818

19-
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir)$(CPPFLAGS)$(PTHREAD_CFLAGS)
19+
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include\
20+
-I$(top_srcdir)/src/include/utils -I$(libpq_srcdir)$(CPPFLAGS)\
21+
$(PTHREAD_CFLAGS) -DFRONTEND
22+
2023
SHLIB_LINK += -lm
2124

2225
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o\

‎src/interfaces/ecpg/preproc/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.102 2004/04/26 17:40:48 momjian Exp $
1+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.103 2004/04/30 04:14:06 momjian Exp $
22

33
subdir = src/interfaces/ecpg/preproc
44
top_builddir = ../../../..
@@ -12,7 +12,8 @@ override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
1212
-DMAJOR_VERSION=$(MAJOR_VERSION)\
1313
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL)\
1414
-DINCLUDEDIR=\"$(includedir)\"\
15-
-DPKGINCLUDEDIR=\"$(pkgincludedir)\"
15+
-DPKGINCLUDEDIR=\"$(pkgincludedir)\"\
16+
-DFRONTEND
1617

1718
ifeq ($(GCC), yes)
1819
overrideCFLAGS += -Wno-error

‎src/interfaces/ecpg/test/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.46 2004/04/25 20:57:32 momjian Exp $
1+
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.47 2004/04/30 04:14:06 momjian Exp $
22

33
subdir = src/interfaces/ecpg/test
44
top_builddir = ../../../..
@@ -9,7 +9,8 @@ override CFLAGS += $(PTHREAD_CFLAGS)
99

1010
ECPG = ../preproc/ecpg -I$(srcdir)/../include
1111

12-
TESTS = test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init testdynalloc num_test dt_test test_informix
12+
TESTS = test1 test2 test3 test4 perftest dyntest dyntest2 test_notice\
13+
test_code100 test_init testdynalloc num_test dt_test test_informix
1314
ifeq ($(enable_thread_safety), yes)
1415
TESTS += test_thread test_thread_implicit
1516
endif

‎src/timezone/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This is a PostgreSQL adapted version of the timezone library
22
from:
3-
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
43

4+
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
55

66
The interface is used when USE_PGTZ is defined at the top level. This
77
will cause the following functions to be redefined:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp