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

Commitd00a347

Browse files
committed
Update MinGW so it handles fseeko() similar to Unix.
1 parent7e518a3 commitd00a347

File tree

5 files changed

+24
-25
lines changed

5 files changed

+24
-25
lines changed

‎configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18999,7 +18999,8 @@ done
1899918999

1900019000
case $host_os in
1900119001
# BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
19002-
bsdi*|netbsd*)
19002+
# Mingw uses macros to access Win32 API calls
19003+
bsdi*|netbsd*|mingw*)
1900319004

1900419005
cat >>confdefs.h <<\_ACEOF
1900519006
#define HAVE_FSEEKO 1

‎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 $PostgreSQL: pgsql/configure.in,v 1.582 2009/01/06 17:27:06 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.583 2009/01/07 03:39:33 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1319,7 +1319,8 @@ AC_CHECK_FUNCS(atexit, [],
13191319
AC_REPLACE_FUNCS(fseeko)
13201320
case $host_os in
13211321
# BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
1322-
bsdi*|netbsd*)
1322+
# Mingw uses macros to access Win32 API calls
1323+
bsdi*|netbsd*|mingw*)
13231324
AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.])
13241325
ac_cv_func_fseeko=yes;;
13251326
*)

‎src/bin/pg_dump/pg_dump.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.145 2009/01/01 17:23:54 momjian Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.146 2009/01/07 03:39:33 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -16,25 +16,6 @@
1616

1717
#include"postgres_fe.h"
1818

19-
/*
20-
* WIN32 does not provide 64-bit off_t, but does provide the functions operating
21-
* with 64-bit offsets.
22-
*/
23-
#ifdefWIN32
24-
#definepgoff_t __int64
25-
#undef fseeko
26-
#undef ftello
27-
#ifdefWIN32_ONLY_COMPILER
28-
#definefseeko(stream,offset,origin) _fseeki64(stream, offset, origin)
29-
#defineftello(stream) _ftelli64(stream)
30-
#else
31-
#definefseeko(stream,offset,origin) fseeko64(stream, offset, origin)
32-
#defineftello(stream) ftello64(stream)
33-
#endif
34-
#else
35-
#definepgoff_t off_t
36-
#endif
37-
3819
/*
3920
* pg_dump uses two different mechanisms for identifying database objects:
4021
*

‎src/include/port.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2009, 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.123 2009/01/01 17:23:55 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.124 2009/01/07 03:39:33 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -341,10 +341,14 @@ extern intgettimeofday(struct timeval * tp, struct timezone * tzp);
341341
externchar*crypt(constchar*key,constchar*setting);
342342
#endif
343343

344+
/* WIN32 handled in port/win32.h */
345+
#ifndefWIN32
346+
#definepgoff_t off_t
344347
#if defined(bsdi)|| defined(netbsd)
345348
externintfseeko(FILE*stream,off_toffset,intwhence);
346349
externoff_tftello(FILE*stream);
347350
#endif
351+
#endif
348352

349353
#ifndefHAVE_FSEEKO
350354
#definefseeko(a,b,c) fseek(a, b, c)

‎src/include/port/win32.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.84 2008/02/17 02:09:31 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.85 2009/01/07 03:39:33 momjian Exp $ */
22

33
#if defined(_MSC_VER)|| defined(__BORLANDC__)
44
#defineWIN32_ONLY_COMPILER
@@ -190,6 +190,18 @@ struct itimerval
190190

191191
intsetitimer(intwhich,conststructitimerval*value,structitimerval*ovalue);
192192

193+
/*
194+
* WIN32 does not provide 64-bit off_t, but does provide the functions operating
195+
* with 64-bit offsets.
196+
*/
197+
#definepgoff_t __int64
198+
#ifdefWIN32_ONLY_COMPILER
199+
#definefseeko(stream,offset,origin) _fseeki64(stream, offset, origin)
200+
#defineftello(stream) _ftelli64(stream)
201+
#else
202+
#definefseeko(stream,offset,origin) fseeko64(stream, offset, origin)
203+
#defineftello(stream) ftello64(stream)
204+
#endif
193205

194206
/*
195207
* Supplement to <sys/types.h>.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp