diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1997-10-16 20:45:58 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1997-10-16 20:45:58 +0000 |
commit | a7f1e86fb26062105dfcdd982330f8ac5f43b866 (patch) | |
tree | 7cca1b68a70b54460b39545751a40f5b43b5a877 /win32 | |
parent | f6ac99e2a11804b59dd260e0bd29ad6b7cabfec6 (diff) | |
parent | 50cfdc516018cd6b6c242109d720adf8fb0e897b (diff) | |
download | perl-a7f1e86fb26062105dfcdd982330f8ac5f43b866.tar.gz |
A quick merge of latest mainline.
p4raw-id: //depot/win32/perl@143
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 25 | ||||
-rw-r--r-- | win32/config_H.bc | 6 | ||||
-rw-r--r-- | win32/config_H.vc | 6 | ||||
-rw-r--r-- | win32/makefile.mk | 15 | ||||
-rw-r--r-- | win32/win32.c | 10 | ||||
-rw-r--r-- | win32/win32io.c | 3 | ||||
-rw-r--r-- | win32/win32sck.c | 32 |
7 files changed, 80 insertions, 17 deletions
diff --git a/win32/Makefile b/win32/Makefile index be954f06d8..70cf2f0fe4 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -202,6 +202,11 @@ WIN32_OBJ = win32.obj \ win32io.obj \ win32sck.obj +PERL95_OBJ = perl95.obj \ + win32mt.obj \ + win32iomt.obj \ + win32sckmt.obj + DLL_OBJ = perllib.obj $(DYNALOADER).obj CORE_H = ..\av.h \ @@ -361,9 +366,15 @@ perl95.obj : perl95.c win32iomt.obj : win32io.c $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32iomt.obj win32io.c -$(PERL95EXE): $(PERLDLL) $(CONFIGPM) perl95.obj win32iomt.obj +win32sckmt.obj : win32sck.c + $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32sckmt.obj win32sck.c + +win32mt.obj : win32.c + $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32mt.obj win32.c + +$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ) $(LINK32) -subsystem:console -out:perl95.exe $(LINK_FLAGS) \ - perl95.obj win32iomt.obj $(PERLIMPLIB) + $(PERL95_OBJ) $(PERLIMPLIB) copy perl95.exe $@ del perl95.exe @@ -480,10 +491,18 @@ minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t cd ..\win32 -test : all +test-prep : all $(XCOPY) $(PERLEXE) ..\t\$(NULL) $(XCOPY) $(PERLDLL) ..\t\$(NULL) $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + +test : test-prep + cd ..\t + $(PERLEXE) -I..\lib harness + cd ..\win32 + +test-notty : test-prep + set PERL_SKIP_TTY_TEST=1 cd ..\t $(PERLEXE) -I..\lib harness cd ..\win32 diff --git a/win32/config_H.bc b/win32/config_H.bc index 1883e973c1..61fb5a3241 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -47,7 +47,11 @@ * where library files may be held under a private library, for * instance. */ -#define ARCHNAME "MSWin32" /**/ +#ifdef _ALPHA_ +#define ARCHNAME "alpha-mswin32" /**/ +#else +#define ARCHNAME "x86-mswin32" /**/ +#endif /* BIN: * This symbol holds the path of the bin directory where the package will diff --git a/win32/config_H.vc b/win32/config_H.vc index 36a9a5b0d4..76f19f1d87 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -47,7 +47,11 @@ * where library files may be held under a private library, for * instance. */ -#define ARCHNAME "MSWin32" /**/ +#ifdef _ALPHA_ +#define ARCHNAME "alpha-mswin32" /**/ +#else +#define ARCHNAME "x86-mswin32" /**/ +#endif /* BIN: * This symbol holds the path of the bin directory where the package will diff --git a/win32/makefile.mk b/win32/makefile.mk index c913ed73f0..a8ab369678 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -269,6 +269,11 @@ WIN32_OBJ = win32.obj \ win32io.obj \ win32sck.obj +PERL95_OBJ = perl95.obj \ + win32mt.obj \ + win32iomt.obj \ + win32sckmt.obj + DLL_OBJ = perllib.obj $(DYNALOADER).obj CORE_H = ..\av.h \ @@ -461,9 +466,15 @@ perl95.obj : perl95.c win32iomt.obj : win32io.c $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32iomt.obj win32io.c -$(PERL95EXE): $(PERLDLL) $(CONFIGPM) perl95.obj win32iomt.obj +win32sckmt.obj : win32sck.c + $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32sckmt.obj win32sck.c + +win32mt.obj : win32.c + $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32mt.obj win32.c + +$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ) $(LINK32) -subsystem:console -out:perl95.exe $(LINK_FLAGS) \ - perl95.obj win32iomt.obj $(PERLIMPLIB) + $(PERL95_OBJ) $(PERLIMPLIB) copy perl95.exe $@ del perl95.exe diff --git a/win32/win32.c b/win32/win32.c index 7a4c2852db..7cbfae8a83 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1564,6 +1564,7 @@ XS(w32_GetShortPathName) { dXSARGS; SV *shortpath; + DWORD len; if(items != 1) croak("usage: Win32::GetShortPathName($longPathName)"); @@ -1571,8 +1572,15 @@ XS(w32_GetShortPathName) shortpath = sv_mortalcopy(ST(0)); SvUPGRADE(shortpath, SVt_PV); /* src == target is allowed */ - if (GetShortPathName(SvPVX(shortpath), SvPVX(shortpath), SvCUR(shortpath))) + do { + len = GetShortPathName(SvPVX(shortpath), + SvPVX(shortpath), + SvLEN(shortpath)); + } while (len >= SvLEN(shortpath) && sv_grow(shortpath,len+1)); + if (len) { + SvCUR_set(shortpath,len); ST(0) = shortpath; + } else ST(0) = &sv_undef; XSRETURN(1); diff --git a/win32/win32io.c b/win32/win32io.c index 12bc645d2d..eeb684620b 100644 --- a/win32/win32io.c +++ b/win32/win32io.c @@ -238,6 +238,7 @@ my_flock(int fd, int oper) #undef LK_ERR #undef LK_LEN +EXT int my_fclose(FILE *pf); #ifdef PERLDLL __declspec(dllexport) @@ -259,7 +260,7 @@ WIN32_IOSUBSYSTEM win32stdio = { fopen, /* (*pfunc_fopen)(const char *path, const char *mode); */ fdopen, /* (*pfunc_fdopen)(int fh, const char *mode); */ freopen, /* (*pfunc_freopen)(const char *path, const char *mode, FILE *pf); */ - fclose, /* (*pfunc_fclose)(FILE *pf); */ + my_fclose, /* (*pfunc_fclose)(FILE *pf); */ fputs, /* (*pfunc_fputs)(const char *s,FILE *pf); */ fputc, /* (*pfunc_fputc)(int c,FILE *pf); */ ungetc, /* (*pfunc_ungetc)(int c,FILE *pf); */ diff --git a/win32/win32sck.c b/win32/win32sck.c index d541a7e3ba..3653fc8b88 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -227,11 +227,11 @@ myfdopen(int fd, char *mode) int retval; if (hWinSockDll == 0) - LoadWinSock(); + return(fdopen(fd, mode)); retval = pgetsockopt((SOCKET)fd, SOL_SOCKET, SO_TYPE, sockbuf, &optlen); if(retval == SOCKET_ERROR && pWSAGetLastError() == WSAENOTSOCK) { - return(_fdopen(fd, mode)); + return(fdopen(fd, mode)); } /* @@ -258,7 +258,7 @@ u_long win32_htonl(u_long hostlong) { if(hWinSockDll == 0) - LoadWinSock(); + StartSockets(); return phtonl(hostlong); } @@ -267,7 +267,7 @@ u_short win32_htons(u_short hostshort) { if(hWinSockDll == 0) - LoadWinSock(); + StartSockets(); return phtons(hostshort); } @@ -276,7 +276,7 @@ u_long win32_ntohl(u_long netlong) { if(hWinSockDll == 0) - LoadWinSock(); + StartSockets(); return pntohl(netlong); } @@ -285,7 +285,7 @@ u_short win32_ntohs(u_short netshort) { if(hWinSockDll == 0) - LoadWinSock(); + StartSockets(); return pntohs(netshort); } @@ -503,6 +503,22 @@ win32_socket(int af, int type, int protocol) return s; } +#undef fclose +int +my_fclose (FILE *pf) +{ + int osf, retval; + if (hWinSockDll == 0) /* No WinSockDLL? */ + return(fclose(pf)); /* Then not a socket. */ + osf = TO_SOCKET(fileno(pf)); /* Get it now before it's gone! */ + retval = fclose(pf); /* Must fclose() before closesocket() */ + if (osf != -1 + && pclosesocket(osf) == SOCKET_ERROR + && WSAGetLastError() != WSAENOTSOCK) + retval = EOF; + return retval; +} + struct hostent * win32_gethostbyaddr(const char *addr, int len, int type) { @@ -576,7 +592,7 @@ char FAR * win32_inet_ntoa(struct in_addr in) { if(hWinSockDll == 0) - LoadWinSock(); + StartSockets(); return pinet_ntoa(in); } @@ -585,7 +601,7 @@ unsigned long win32_inet_addr(const char FAR *cp) { if(hWinSockDll == 0) - LoadWinSock(); + StartSockets(); return pinet_addr(cp); |