This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
5005threads builds again on windows
[perl5.git] / win32 / win32io.c
index 8e74608..4e61aaa 100644 (file)
 #include <sys/stat.h>
 #include "EXTERN.h"
 #include "perl.h"
+
+#ifdef PERLIO_LAYERS
+
 #include "perliol.h"
 
 #define NO_XSLOCKS
 #include "XSUB.h"
 
+
 /* Bottom-most level for Win32 case */
 
 typedef struct
@@ -179,7 +183,7 @@ PerlIOWin32_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const ch
     }
   }
  if (h != INVALID_HANDLE_VALUE)
-  fd = win32_open_osfhandle((long) h, PerlIOUnix_oflags(tmode));
+  fd = win32_open_osfhandle((intptr_t) h, PerlIOUnix_oflags(tmode));
  if (fd >= 0)
   {
    PerlIOWin32 *s;
@@ -303,7 +307,7 @@ PerlIOWin32_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *params, int flags)
  if (DuplicateHandle(proc, os->h, proc, &new, 0, FALSE,  DUPLICATE_SAME_ACCESS))
   {
    char mode[8];
-   int fd = win32_open_osfhandle((long) new, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
+   int fd = win32_open_osfhandle((intptr_t) new, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
    if (fd >= 0) 
     {
      f = PerlIOBase_dup(aTHX_ f, o, params, flags);
@@ -359,5 +363,5 @@ PerlIO_funcs PerlIO_win32 = {
  NULL, /* set_ptrcnt */
 };
 
-
+#endif