From: Steve Hay Date: Fri, 22 Feb 2008 12:17:17 +0000 (+0000) Subject: Silence warning from VC8 when building without USE_LARGE_FILES X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3caf316a13f5dcb18f6ada1f6b447887564ff3ae;p=p5sagit%2Fp5-mst-13.2.git Silence warning from VC8 when building without USE_LARGE_FILES p4raw-id: //depot/perl@33344 --- diff --git a/win32/win32io.c b/win32/win32io.c index 5ba46a7..a3981c0 100644 --- a/win32/win32io.c +++ b/win32/win32io.c @@ -256,7 +256,11 @@ PerlIOWin32_seek(pTHX_ PerlIO *f, Off_t offset, int whence) { static const DWORD where[3] = { FILE_BEGIN, FILE_CURRENT, FILE_END }; PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - DWORD high = (sizeof(offset) > sizeof(DWORD)) ? (DWORD)(offset >> 32) : 0; +#if Off_t_size >= 8 + DWORD high = (DWORD)(offset >> 32); +#else + DWORD high = 0; +#endif DWORD low = (DWORD) offset; DWORD res = SetFilePointer(s->h,(LONG)low,(LONG *)&high,where[whence]); if (res != 0xFFFFFFFF || GetLastError() != NO_ERROR) @@ -277,7 +281,11 @@ PerlIOWin32_tell(pTHX_ PerlIO *f) DWORD res = SetFilePointer(s->h,0,(LONG *)&high,FILE_CURRENT); if (res != 0xFFFFFFFF || GetLastError() != NO_ERROR) { +#if Off_t_size >= 8 return ((Off_t) high << 32) | res; +#else + return res; +#endif } return (Off_t) -1; }