}
IV
-PerlIOWin32_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg)
+PerlIOWin32_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
- IV code = PerlIOBase_pushed(aTHX_ f,mode,arg);
+ IV code = PerlIOBase_pushed(aTHX_ f,mode,arg,tab);
if (*PerlIONext(f))
{
PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32);
{
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,low,&high,where[whence]);
+ DWORD res = SetFilePointer(s->h,(LONG)low,(LONG *)&high,where[whence]);
if (res != 0xFFFFFFFF || GetLastError() != NO_ERROR)
{
return 0;
{
PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32);
DWORD high = 0;
- DWORD res = SetFilePointer(s->h,0,&high,FILE_CURRENT);
+ 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;
}
{
PerlIOWin32 *os = PerlIOSelf(f,PerlIOWin32);
HANDLE proc = GetCurrentProcess();
- HANDLE new;
- if (DuplicateHandle(proc, os->h, proc, &new, 0, FALSE, DUPLICATE_SAME_ACCESS))
+ HANDLE new_h;
+ if (DuplicateHandle(proc, os->h, proc, &new_h, 0, FALSE, DUPLICATE_SAME_ACCESS))
{
char mode[8];
- int fd = win32_open_osfhandle((intptr_t) new, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
+ int fd = win32_open_osfhandle((intptr_t) new_h, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
if (fd >= 0)
{
f = PerlIOBase_dup(aTHX_ f, o, params, flags);
if (f)
{
PerlIOWin32 *fs = PerlIOSelf(f,PerlIOWin32);
- fs->h = new;
+ fs->h = new_h;
fs->fd = fd;
fs->refcnt = 1;
fdtable[fd] = fs;
}
else
{
- CloseHandle(new);
+ CloseHandle(new_h);
}
}
return f;
}
-PerlIO_funcs PerlIO_win32 = {
+PERLIO_FUNCS_DECL(PerlIO_win32) = {
+ sizeof(PerlIO_funcs),
"win32",
sizeof(PerlIOWin32),
PERLIO_K_RAW,