summaryrefslogtreecommitdiffstats
path: root/generic/tclIOSock.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-12-10 15:44:53 (GMT)
committernijtmans <nijtmans>2010-12-10 15:44:53 (GMT)
commit64525a0fe7a4adf2979acea69ebb53a3bd8e2071 (patch)
treebcdbfc2eda856f5fabedc7b7e3c2f36825fdd8c7 /generic/tclIOSock.c
parent806fc96e112242a089ea4a824e37307244b5269c (diff)
downloadtcl-64525a0fe7a4adf2979acea69ebb53a3bd8e2071.zip
tcl-64525a0fe7a4adf2979acea69ebb53a3bd8e2071.tar.gz
tcl-64525a0fe7a4adf2979acea69ebb53a3bd8e2071.tar.bz2
Change first parameter of TclSockMinimumBuffers to ClientData, and TclWin(Get|Set)SockOpt to SOCKET, because on Win64 those are 64-bit, which does not fit.
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r--generic/tclIOSock.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 72ad64d..884ec65 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOSock.c,v 1.14 2010/10/26 16:14:19 rmax Exp $
+ * RCS: @(#) $Id: tclIOSock.c,v 1.15 2010/12/10 15:44:54 nijtmans Exp $
*/
#include "tclInt.h"
@@ -89,25 +89,30 @@ TclSockGetPort(
*----------------------------------------------------------------------
*/
+#ifdef _WIN32
+# define PTR2SOCK(a) (SOCKET)a
+#else
+# define PTR2SOCK(a) PTR2INT(a)
+#endif
int
TclSockMinimumBuffers(
- int sock, /* Socket file descriptor */
+ ClientData sock, /* Socket file descriptor */
int size) /* Minimum buffer size */
{
int current;
socklen_t len;
len = sizeof(int);
- getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&current, &len);
+ getsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_SNDBUF, (char *)&current, &len);
if (current < size) {
len = sizeof(int);
- setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len);
+ setsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_SNDBUF, (char *)&size, len);
}
len = sizeof(int);
- getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&current, &len);
+ getsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_RCVBUF, (char *)&current, &len);
if (current < size) {
len = sizeof(int);
- setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len);
+ setsockopt(PTR2SOCK(sock), SOL_SOCKET, SO_RCVBUF, (char *)&size, len);
}
return TCL_OK;
}