X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=doio.c;h=a52df3e78437750f694a9a7eca2392a3207f8e6f;hb=40251396974db33216dc0c9382c9de3ab9b3d764;hp=8c4c2678e2c4040f2746364de7f2d9291044228b;hpb=9607fc9c489d4095e3baa795d7ead7acba96137d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/doio.c b/doio.c index 8c4c267..a52df3e 100644 --- a/doio.c +++ b/doio.c @@ -34,7 +34,11 @@ #endif #ifdef I_UTIME -#include +# ifdef WIN32 +# include +# else +# include +# endif #endif #ifdef I_FCNTL #include @@ -62,6 +66,15 @@ # endif #endif +/* Put this after #includes because defines _XOPEN_*. */ +#ifndef Sock_size_t +# if _XOPEN_VERSION >= 5 || defined(_XOPEN_SOURCE_EXTENDED) +# define Sock_size_t Size_t +# else +# define Sock_size_t int +# endif +#endif + bool do_open(gv,name,len,as_raw,rawmode,rawperm,supplied_fp) GV *gv; @@ -284,9 +297,10 @@ PerlIO *supplied_fp; !statbuf.st_mode #endif ) { - int buflen = sizeof tokenbuf; - if (getsockname(PerlIO_fileno(fp), (struct sockaddr *)tokenbuf, &buflen) >= 0 - || errno != ENOTSOCK) + Sock_size_t buflen = sizeof tokenbuf; + if (getsockname(PerlIO_fileno(fp), (struct sockaddr *)tokenbuf, + &buflen) >= 0 + || errno != ENOTSOCK) IoTYPE(io) = 's'; /* some OS's return 0 on fstat()ed socket */ /* but some return 0 for streams too, sigh */ }