From d00a3472cfc4f7c429538e2dfdc4656244984f9d Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 7 Jan 2009 03:39:33 +0000 Subject: Update MinGW so it handles fseeko() similar to Unix. --- src/bin/pg_dump/pg_dump.h | 21 +-------------------- src/include/port.h | 6 +++++- src/include/port/win32.h | 14 +++++++++++++- 3 files changed, 19 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 3bb3f47f5d4..0e938c851ec 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.145 2009/01/01 17:23:54 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.146 2009/01/07 03:39:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,25 +16,6 @@ #include "postgres_fe.h" -/* - * WIN32 does not provide 64-bit off_t, but does provide the functions operating - * with 64-bit offsets. - */ -#ifdef WIN32 -#define pgoff_t __int64 -#undef fseeko -#undef ftello -#ifdef WIN32_ONLY_COMPILER -#define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin) -#define ftello(stream) _ftelli64(stream) -#else -#define fseeko(stream, offset, origin) fseeko64(stream, offset, origin) -#define ftello(stream) ftello64(stream) -#endif -#else -#define pgoff_t off_t -#endif - /* * pg_dump uses two different mechanisms for identifying database objects: * diff --git a/src/include/port.h b/src/include/port.h index 4ccf410f600..ff139468be7 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/port.h,v 1.123 2009/01/01 17:23:55 momjian Exp $ + * $PostgreSQL: pgsql/src/include/port.h,v 1.124 2009/01/07 03:39:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -341,10 +341,14 @@ extern int gettimeofday(struct timeval * tp, struct timezone * tzp); extern char *crypt(const char *key, const char *setting); #endif +/* WIN32 handled in port/win32.h */ +#ifndef WIN32 +#define pgoff_t off_t #if defined(bsdi) || defined(netbsd) extern int fseeko(FILE *stream, off_t offset, int whence); extern off_t ftello(FILE *stream); #endif +#endif #ifndef HAVE_FSEEKO #define fseeko(a, b, c) fseek(a, b, c) diff --git a/src/include/port/win32.h b/src/include/port/win32.h index d670576787e..58baa59bffc 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.84 2008/02/17 02:09:31 tgl Exp $ */ +/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.85 2009/01/07 03:39:33 momjian Exp $ */ #if defined(_MSC_VER) || defined(__BORLANDC__) #define WIN32_ONLY_COMPILER @@ -190,6 +190,18 @@ struct itimerval int setitimer(int which, const struct itimerval * value, struct itimerval * ovalue); +/* + * WIN32 does not provide 64-bit off_t, but does provide the functions operating + * with 64-bit offsets. + */ +#define pgoff_t __int64 +#ifdef WIN32_ONLY_COMPILER +#define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin) +#define ftello(stream) _ftelli64(stream) +#else +#define fseeko(stream, offset, origin) fseeko64(stream, offset, origin) +#define ftello(stream) ftello64(stream) +#endif /* * Supplement to . -- cgit v1.2.3