diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-22 07:30:32 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-22 07:30:32 (GMT) |
commit | 6f812b4ccb74d0aebe4bbf520bd6710fa82cf549 (patch) | |
tree | 93c28fdf3a05fc218fcef72c9e36805bef83072a /win | |
parent | a89ca11a44b7af7cb1017a6cbaf59f53c3e16ed7 (diff) | |
download | tcl-6f812b4ccb74d0aebe4bbf520bd6710fa82cf549.zip tcl-6f812b4ccb74d0aebe4bbf520bd6710fa82cf549.tar.gz tcl-6f812b4ccb74d0aebe4bbf520bd6710fa82cf549.tar.bz2 |
Revert most of [ae92de6078], since when we let cygwin share the win32 stub table this is no longer necessary
implement TclpInetNtoa for win32
Let cygwin share stub table with win32
Diffstat (limited to 'win')
-rw-r--r-- | win/Makefile.in | 14 | ||||
-rw-r--r-- | win/tclWinSock.c | 29 |
2 files changed, 30 insertions, 13 deletions
diff --git a/win/Makefile.in b/win/Makefile.in index f11ef53..58811e5 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -438,7 +438,7 @@ install-binaries: binaries else true; \ fi; \ done; - @for i in dde1.2 reg1.1; \ + @for i in dde$(DDEDOTVER) reg$(REGDOTVER); \ do \ if [ ! -d $(LIB_INSTALL_DIR)/$$i ] ; then \ echo "Making directory $(LIB_INSTALL_DIR)/$$i"; \ @@ -462,23 +462,23 @@ install-binaries: binaries done @if [ -f $(DDE_DLL_FILE) ]; then \ echo installing $(DDE_DLL_FILE); \ - $(COPY) $(DDE_DLL_FILE) $(LIB_INSTALL_DIR)/dde1.2; \ + $(COPY) $(DDE_DLL_FILE) $(LIB_INSTALL_DIR)/dde$(DDEDOTVER); \ $(COPY) $(ROOT_DIR)/library/dde/pkgIndex.tcl \ - $(LIB_INSTALL_DIR)/dde1.2; \ + $(LIB_INSTALL_DIR)/dde$(DDEDOTVER); \ fi @if [ -f $(DDE_LIB_FILE) ]; then \ echo installing $(DDE_LIB_FILE); \ - $(COPY) $(DDE_LIB_FILE) $(LIB_INSTALL_DIR)/dde1.2; \ + $(COPY) $(DDE_LIB_FILE) $(LIB_INSTALL_DIR)/dde$(DDEDOTVER); \ fi @if [ -f $(REG_DLL_FILE) ]; then \ echo installing $(REG_DLL_FILE); \ - $(COPY) $(REG_DLL_FILE) $(LIB_INSTALL_DIR)/reg1.1; \ + $(COPY) $(REG_DLL_FILE) $(LIB_INSTALL_DIR)/reg$(REGDOTVER); \ $(COPY) $(ROOT_DIR)/library/reg/pkgIndex.tcl \ - $(LIB_INSTALL_DIR)/reg1.1; \ + $(LIB_INSTALL_DIR)/reg$(REGDOTVER); \ fi @if [ -f $(REG_LIB_FILE) ]; then \ echo installing $(REG_LIB_FILE); \ - $(COPY) $(REG_LIB_FILE) $(LIB_INSTALL_DIR)/reg1.1; \ + $(COPY) $(REG_LIB_FILE) $(LIB_INSTALL_DIR)/reg$(REGDOTVER); \ fi install-libraries: libraries diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 06d0590..328198b 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -96,7 +96,7 @@ TCL_DECLARE_MUTEX(socketMutex) struct sockaddr FAR *name, int FAR *namelen); typedef int (PASCAL FAR *LPFN_GETSOCKOPT)(SOCKET s, int level, int optname, char FAR * optval, int FAR *optlen); - typedef u_short (PASCAL FAR *LPFN_HTONS)(u_short hostshort); + typedef unsigned short (PASCAL FAR *LPFN_HTONS)(unsigned short hostshort); typedef unsigned long (PASCAL FAR *LPFN_INET_ADDR) (const char FAR * cp); typedef char FAR * (PASCAL FAR *LPFN_INET_NTOA) @@ -104,7 +104,7 @@ TCL_DECLARE_MUTEX(socketMutex) typedef int (PASCAL FAR *LPFN_IOCTLSOCKET)(SOCKET s, long cmd, u_long FAR *argp); typedef int (PASCAL FAR *LPFN_LISTEN)(SOCKET s, int backlog); - typedef u_short (PASCAL FAR *LPFN_NTOHS)(u_short netshort); + typedef unsigned short (PASCAL FAR *LPFN_NTOHS)(unsigned short netshort); typedef int (PASCAL FAR *LPFN_RECV)(SOCKET s, char FAR * buf, int len, int flags); typedef int (PASCAL FAR *LPFN_SELECT)(int nfds, @@ -1320,7 +1320,7 @@ CreateSocketAddress(sockaddrPtr, host, port) ZeroMemory(sockaddrPtr, sizeof(SOCKADDR_IN)); sockaddrPtr->sin_family = AF_INET; - sockaddrPtr->sin_port = winSock.htons((u_short) (port & 0xFFFF)); + sockaddrPtr->sin_port = winSock.htons((unsigned short) (port & 0xFFFF)); if (host == NULL) { addr.s_addr = INADDR_ANY; } else { @@ -2678,8 +2678,8 @@ TclWinSetSockOpt(SOCKET s, int level, int optname, const char * optval, return winSock.setsockopt(s, level, optname, optval, optlen); } -u_short -TclWinNToHS(u_short netshort) +unsigned short +TclWinNToHS(unsigned short netshort) { /* * Check that WinSock is initialized; do not call it if not, to @@ -2689,12 +2689,29 @@ TclWinNToHS(u_short netshort) */ if (!SocketsEnabled()) { - return (u_short) -1; + return (unsigned short) -1; } return winSock.ntohs(netshort); } +char * +TclpInetNtoa(struct in_addr addr) +{ + /* + * Check that WinSock is initialized; do not call it if not, to + * prevent system crashes. This can happen at exit time if the exit + * handler for WinSock ran before other exit handlers that want to + * use sockets. + */ + + if (!SocketsEnabled()) { + return NULL; + } + + return winSock.inet_ntoa(addr); +} + struct servent * TclWinGetServByName(const char * name, const char * proto) { |