diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-20 08:59:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-20 08:59:36 (GMT) |
commit | 4c681f294b0469fff7d65e9c8718ccf2ff128b2c (patch) | |
tree | 807dbba5af2220d8b1e8baf1533e52017acef1cc | |
parent | 926ab55b307cab1b410ff1afef347dc73497b7fa (diff) | |
download | tcl-4c681f294b0469fff7d65e9c8718ccf2ff128b2c.zip tcl-4c681f294b0469fff7d65e9c8718ccf2ff128b2c.tar.gz tcl-4c681f294b0469fff7d65e9c8718ccf2ff128b2c.tar.bz2 |
Remove wrapper macro for ntohs(): unnecessary, because it doesn't require an initialized winsock_2 library
-rw-r--r-- | generic/tclStubInit.c | 7 | ||||
-rw-r--r-- | win/tclWinPort.h | 1 | ||||
-rw-r--r-- | win/tclWinSock.c | 22 |
3 files changed, 3 insertions, 27 deletions
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 7b73ee3..3be6b45 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -74,6 +74,7 @@ MODULE_SCOPE TclIntPlatStubs tclIntPlatStubs; MODULE_SCOPE TclPlatStubs tclPlatStubs; MODULE_SCOPE TclStubs tclStubs; MODULE_SCOPE TclTomMathStubs tclTomMathStubs; +#define TclWinNToHS ntohs #ifdef __WIN32__ # define TclUnixWaitForFile 0 @@ -112,12 +113,6 @@ void *TclWinGetTclInstance() return hInstance; } -unsigned short -TclWinNToHS(unsigned short ns) -{ - return ntohs(ns); -} - int TclWinSetSockOpt(SOCKET s, int level, int optname, const char *optval, int optlen) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 4f9e8b8..f58014c 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -457,7 +457,6 @@ typedef DWORD_PTR * PDWORD_PTR; #define getservbyname TclWinGetServByName #define getsockopt TclWinGetSockOpt -#define ntohs TclWinNToHS #define setsockopt TclWinSetSockOpt /* This type is not defined in the Windows headers */ #define socklen_t int diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 63f166d..8f2028d 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -65,7 +65,6 @@ #undef getservbyname #undef getsockopt -#undef ntohs #undef setsockopt /* @@ -131,7 +130,7 @@ typedef struct SocketInfo { * socket event occurs. */ -typedef struct SocketEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ SOCKET socket; /* Socket descriptor that is ready. Used to @@ -159,7 +158,7 @@ typedef struct SocketEvent { #define SOCKET_PENDING (1<<3) /* A message has been sent for this * socket */ -typedef struct ThreadSpecificData { +typedef struct { HWND hwnd; /* Handle to window for socket messages. */ HANDLE socketThread; /* Thread handling the window */ Tcl_ThreadId threadId; /* Parent thread. */ @@ -2508,23 +2507,6 @@ TclWinSetSockOpt(SOCKET s, int level, int optname, const char *optval, return setsockopt(s, level, optname, optval, optlen); } -unsigned short -TclWinNToHS(unsigned short netshort) -{ - /* - * 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 (unsigned short) -1; - } - - return ntohs(netshort); -} - char * TclpInetNtoa(struct in_addr addr) { |