Skip to content
Tcl Source Code View Ticket
Login

View Ticket

#define layering in tclWinSock.c

Closed / Fixed561301ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 24 years ago
Descriptionplain2002-05-28 00:27:06
win/tclWinPort.h sets the following defines:

/*
 * The following defines map from standard socket 
names to our internal
 * wrappers that redirect through the winSock function 
table (see the
 * file tclWinSock.c).
 */

#define getservbynameTclWinGetServByName
#define getsockoptTclWinGetSockOpt
#define ntohsTclWinNToHS
#define setsockoptTclWinSetSockOpt


These are not undefined when building tclWinSock.c, so 
the winSock function table (internally) has 
winSock.TclWinNToHS for what should be 
winSock.ntohs as the symbol name.  This isn't causing 
any confusion as TclWinNToHS() calls 
winSock.TclWinNToHS, but isn't a good way of doing 
things and isn't what was meant to happen.

Reminds me of the #define panic in tcl.h that causes 
problems in Berkeley DB as it uses panic in a structure 
name, and has caused a whole mess of problems for 
me in the past.
davygrvyplain2002-05-28 07:27:06
File Added - 23847: patch.txt
davygrvyplain2002-06-11 05:12:42
Logged In: YES 
user_id=7549

PS. yet *another* reason to get TclSockMinimumBuffers out 
of tclIOSock.c and into a native source file like tclWinSock.c

Why wrap in convoluded #defines what should be done with 
platform specific code?  At least there, the SOCKET != int 
issue under win64 can be handled gracefully.
davygrvyplain2002-11-27 09:34:23
Logged In: YES 
user_id=7549

added to HEAD.
Log in (anonymous is fine) to add a comment.

Attachments: