summaryrefslogtreecommitdiffstats
path: root/generic/tclIOSock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-04 09:54:04 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-04 09:54:04 (GMT)
commit9855c2064841f15ef345e5cd92f960e15b77e58c (patch)
treee44f96316e91a4399fbeac746ffe40fd96597380 /generic/tclIOSock.c
parent0148a9e862d2ee5bd69d296abae1ab28fad4f6d0 (diff)
parent9d18f21a9b72dcd0b9d2bd5f29b80390560e1952 (diff)
downloadtcl-9855c2064841f15ef345e5cd92f960e15b77e58c.zip
tcl-9855c2064841f15ef345e5cd92f960e15b77e58c.tar.gz
tcl-9855c2064841f15ef345e5cd92f960e15b77e58c.tar.bz2
[Bug 510001]: TclSockMinimumBuffers needs plat imp
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r--generic/tclIOSock.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 768428f..391939c 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -87,30 +87,29 @@ TclSockGetPort(
*----------------------------------------------------------------------
*/
-#ifdef _WIN32
-# define PTR2SOCK(a) (SOCKET)a
-#else
-# define PTR2SOCK(a) PTR2INT(a)
+#ifndef _WIN32
+# define SOCKET int
#endif
+
int
TclSockMinimumBuffers(
- ClientData sock, /* Socket file descriptor */
+ void *sock, /* Socket file descriptor */
int size) /* Minimum buffer size */
{
int current;
socklen_t len;
len = sizeof(int);
- getsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_SNDBUF, (char *)&current, &len);
+ getsockopt((SOCKET)sock, SOL_SOCKET, SO_SNDBUF, (char *)&current, &len);
if (current < size) {
len = sizeof(int);
- setsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_SNDBUF, (char *)&size, len);
+ setsockopt((SOCKET)sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len);
}
len = sizeof(int);
- getsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_RCVBUF, (char *)&current, &len);
+ getsockopt((SOCKET)sock, SOL_SOCKET, SO_RCVBUF, (char *)&current, &len);
if (current < size) {
len = sizeof(int);
- setsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_RCVBUF, (char *)&size, len);
+ setsockopt((SOCKET)sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len);
}
return TCL_OK;
}