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

Commita640845

Browse files
committed
Allow timezone to compile under Unix by blocking 'timezone' conflict with
system headers.Allow system to find timezone database by pasing pkglibdir into thebinary via a define.
1 parente9a028f commita640845

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

‎src/timezone/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
# Makefile for the timezone library
55

66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.2 2004/04/3004:31:52 momjian Exp $
7+
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.3 2004/04/3014:24:14 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

11-
subdir = src/tz
11+
subdir = src/timezone
1212
top_builddir = ../..
1313
include$(top_builddir)/src/Makefile.global
1414

15+
overrideCPPFLAGS += -DPKGLIBDIR=\"$(pkglibdir)\"
16+
1517
OBJS= asctime.o difftime.o localtime.o pgtz.o
1618
ZICOBJS= zic.o ialloc.o scheck.o localtime.o asctime.o pgtz.o
1719

@@ -25,6 +27,7 @@ SUBSYS.o: $(OBJS)
2527
$(LD)$(LDREL)$(LDOUT) SUBSYS.o$(OBJS)
2628

2729
zic:$(ZICOBJS)
30+
$(CC)$(CFLAGS)$(ZICOBJS)$(LDFLAGS)$(LIBS) -o$@$(X)
2831

2932
install: zic
3033
zic -d$(datadir)/timezone$(TZDATAFILES)

‎src/timezone/pgtz.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.1 2004/04/3004:09:23 momjian Exp $
9+
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.2 2004/04/3014:24:14 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -15,28 +15,28 @@
1515
#include"tzfile.h"
1616

1717

18-
#ifdefWIN32
1918
staticchartzdir[MAXPGPATH];
2019
staticintdone_tzdir=0;
2120
char*pgwin32_TZDIR(void) {
2221
char*p;
2322
if (done_tzdir)
2423
returntzdir;
2524

25+
#ifndefWIN32
26+
StrNCpy(tzdir,PKGLIBDIR,MAXPGPATH);
27+
#else
2628
if (GetModuleFileName(NULL,tzdir,MAXPGPATH)==0)
2729
returnNULL;
30+
#endif
2831

2932
canonicalize_path(tzdir);
3033
if ((p=last_path_separator(tzdir))==NULL)
3134
returnNULL;
3235
else
3336
*p='\0';
3437

35-
strcat(tzdir,"/../share/timezone");
38+
strcat(tzdir,"/../timezone");
3639

3740
done_tzdir=1;
3841
returntzdir;
3942
}
40-
#else
41-
#error pgwin32_TZDIR not implemented on non win32 yet!
42-
#endif

‎src/timezone/private.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ static charprivatehid[] = "@(#)private.h7.53";
8888
#include"errno.h"
8989
#include"string.h"
9090
#include"limits.h"/* for CHAR_BIT */
91+
#define_timezone timezone
92+
#undef timezone
9193
#include"time.h"
94+
#definetimezone _timezone
95+
#undef _timezone
9296
#include"stdlib.h"
9397

9498
#ifHAVE_GETTEXT-0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp