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

Commitec5e0ef

Browse files
committed
Reorganize Win32 includes to only include <port.h> after system includes
under Win32. Also fix other compile issues.
1 parent5e04f38 commitec5e0ef

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

‎configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11397,7 +11397,8 @@ esac
1139711397
# Win32 can't to rename or unlink on an open file
1139811398
case$host_osin mingw*)
1139911399
LIBOBJS="$LIBOBJS dirmod.$ac_objext"
11400-
LIBOBJS="$LIBOBJS copydir.$ac_objext" ;;
11400+
LIBOBJS="$LIBOBJS copydir.$ac_objext"
11401+
LIBOBJS="$LIBOBJS gettimeofday.$ac_objext" ;;
1140111402
esac
1140211403
1140311404
iftest"$with_readline" = yes;then

‎configure.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.251 2003/05/15 17:59:17 momjian Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.252 2003/05/16 01:57:51 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -865,7 +865,8 @@ esac
865865
# Win32 can't to rename or unlink on an open file
866866
case $host_os in mingw*)
867867
AC_LIBOBJ(dirmod)
868-
AC_LIBOBJ(copydir) ;;
868+
AC_LIBOBJ(copydir)
869+
AC_LIBOBJ(gettimeofday) ;;
869870
esac
870871

871872
if test "$with_readline" = yes; then

‎src/include/c.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.146 2003/05/15 23:39:27 tgl Exp $
15+
* $Id: c.h,v 1.147 2003/05/16 01:57:51 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -52,7 +52,9 @@
5252

5353
#include"pg_config.h"
5454
#include"pg_config_manual.h"/* must be after pg_config.h */
55+
#ifndefWIN32
5556
#include"pg_config_os.h"/* must be before any system header files */
57+
#endif
5658
#include"postgres_ext.h"
5759

5860
#include<stdio.h>
@@ -71,6 +73,11 @@
7173
#include<SupportDefs.h>
7274
#endif
7375

76+
#ifdefWIN32
77+
/* We have to redefine some system functions after they are included above */
78+
#include"pg_config_os.h"
79+
#endif
80+
7481
/* Must be before gettext() games below */
7582
#include<locale.h>
7683

‎src/include/port.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: port.h,v 1.1 2003/05/15 16:35:29 momjian Exp $
9+
* $Id: port.h,v 1.2 2003/05/16 01:57:51 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -22,21 +22,26 @@ int fseeko(FILE *stream, off_t offset, int whence);
2222
off_tftello(FILE*stream);
2323
#endif
2424

25+
#ifdefWIN32
2526
/*
2627
* Win32 doesn't have reliable rename/unlink during concurrent access
2728
*/
28-
#if defined(WIN32)&& !defined(FRONTEND)
29+
#ifndefFRONTEND
2930
intpgrename(constchar*from,constchar*to);
3031
intpgunlink(constchar*path);
3132
#definerename(from,to)pgrename(from, to)
3233
#defineunlink(path)pgunlink(path)
3334
#endif
3435

36+
externintcopydir(char*fromdir,char*todir);
37+
externintgettimeofday(structtimeval*tp,structtimezone*tzp);
38+
39+
#else
40+
3541
/*
3642
*Win32 requires a special close for sockets and pipes, while on Unix
3743
*close() does them all.
3844
*/
39-
#ifndefWIN32
4045
#defineclosesocket close
4146
#endif
4247

@@ -45,7 +50,7 @@ int pgunlink(const char *path);
4550
* When necessary, these routines are provided by files in src/port/.
4651
*/
4752
#ifndefHAVE_CRYPT
48-
char*crypt(constchar*key,constchar*setting);
53+
externchar*crypt(constchar*key,constchar*setting);
4954
#endif
5055

5156
#ifndefHAVE_FSEEKO
@@ -90,4 +95,3 @@ extern long random(void);
9095
#ifndefHAVE_SRANDOM
9196
externvoidsrandom(unsignedintseed);
9297
#endif
93-

‎src/port/copydir.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
#include"postgres.h"
88

9+
#undef mkdir/* no reason to use that macro because we ignore the 2nd arg */
10+
11+
#include"dirent.h"
12+
13+
914
int
1015
copydir(char*fromdir,char*todir)
1116
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp