diff options
author | Bruce Momjian | 2009-01-07 03:39:33 +0000 |
---|---|---|
committer | Bruce Momjian | 2009-01-07 03:39:33 +0000 |
commit | be57bebc89e5cc4efa3d10804f1c056fff548718 (patch) | |
tree | 88270f769e9de7b5e3f31d7c85a01df4b2ac4659 | |
parent | 525cfe336c8c141477fea10178cdba8a234dcf8f (diff) |
Update MinGW so it handles fseeko() similar to Unix.
-rwxr-xr-x | configure | 3 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_dump.h | 19 | ||||
-rw-r--r-- | src/include/port.h | 4 | ||||
-rw-r--r-- | src/include/port/win32.h | 12 |
5 files changed, 20 insertions, 21 deletions
@@ -18999,7 +18999,8 @@ done case $host_os in # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos - bsdi*|netbsd*) + # Mingw uses macros to access Win32 API calls + bsdi*|netbsd*|mingw*) cat >>confdefs.h <<\_ACEOF #define HAVE_FSEEKO 1 diff --git a/configure.in b/configure.in index 13a071461b..e437112d08 100644 --- a/configure.in +++ b/configure.in @@ -1319,7 +1319,8 @@ AC_CHECK_FUNCS(atexit, [], AC_REPLACE_FUNCS(fseeko) case $host_os in # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos - bsdi*|netbsd*) + # Mingw uses macros to access Win32 API calls + bsdi*|netbsd*|mingw*) AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.]) ac_cv_func_fseeko=yes;; *) diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 4cab10aae7..53467bc626 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -17,25 +17,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: * * CatalogId represents an object by the tableoid and oid of its defining diff --git a/src/include/port.h b/src/include/port.h index 56a45195fe..0557dd244d 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -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 fc65515fb5..256b71fbdc 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -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 <sys/types.h>. |