Tcl Source Code

View Ticket
Login
Ticket UUID: 561301
Title: #define layering in tclWinSock.c
Type: Patch Version: None
Submitter: davygrvy Created on: 2002-05-28 00:27:06
Subsystem: 25. Channel System Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-11-27 09:34:23
Resolution: Fixed Closed By: davygrvy
    Closed on: 2002-11-27 02:34:23
Description:
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.
User Comments: davygrvy added on 2002-11-27 09:34:23:
Logged In: YES 
user_id=7549

added to HEAD.

davygrvy added on 2002-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.

davygrvy added on 2002-05-28 07:27:06:

File Added - 23847: patch.txt

Attachments: