From 4cebd021b04edb4be39a316f27d2c7371905ff00 Mon Sep 17 00:00:00 2001 From: janwas Date: Sun, 9 Aug 2009 17:04:17 +0000 Subject: [PATCH] fix insidious 32-bit bug that was causing invalid struct stat offsets This was SVN commit r7100. --- source/lib/sysdep/os/win/wposix/wposix_types.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/lib/sysdep/os/win/wposix/wposix_types.h b/source/lib/sysdep/os/win/wposix/wposix_types.h index 843e2e3419..4a82cd17e6 100644 --- a/source/lib/sysdep/os/win/wposix/wposix_types.h +++ b/source/lib/sysdep/os/win/wposix/wposix_types.h @@ -70,9 +70,13 @@ typedef intptr_t ssize_t; // prevent wxWidgets from (incompatibly) redefining it #define HAVE_SSIZE_T -// VC9 defines this as long, which is unacceptable. +// VC9 defines off_t as long, but we need 64-bit file offsets even in +// 32-bit builds. to avoid conflicts, we have to define _OFF_T_DEFINED, +// which promises _off_t has also been defined. since that's used by +// CRT headers, we have to define it too, but must use the original +// long type to avoid breaking struct stat et al. typedef __int64 off_t; -typedef off_t _off_t; // used by wchar.h +typedef long _off_t; #define _OFF_T_DEFINED