summaryrefslogtreecommitdiffstats
path: root/generic
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
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')
-rw-r--r--generic/tclIOSock.c17
-rw-r--r--generic/tclInt.decls8
-rw-r--r--generic/tclIntDecls.h6
-rw-r--r--generic/tclIntPlatDecls.h10
4 files changed, 23 insertions, 18 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;
}
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index eb18d99..61f25d8 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tclInt.decls,v 1.152 2010/11/30 18:17:26 hobbs Exp $
+# RCS: @(#) $Id: tclInt.decls,v 1.153 2010/12/10 15:44:53 nijtmans Exp $
library tcl
@@ -423,7 +423,7 @@ declare 103 {
int *portPtr)
}
declare 104 {
- int TclSockMinimumBuffers(int sock, int size)
+ int TclSockMinimumBuffers(ClientData sock, int size)
}
# Replaced by Tcl_FSStat in 8.4:
#declare 105 {
@@ -1023,7 +1023,7 @@ declare 2 win {
const char *proto)
}
declare 3 win {
- int TclWinGetSockOpt(int s, int level, int optname,
+ int TclWinGetSockOpt(SOCKET s, int level, int optname,
char FAR *optval, int FAR *optlen)
}
declare 4 win {
@@ -1037,7 +1037,7 @@ declare 6 win {
u_short TclWinNToHS(u_short ns)
}
declare 7 win {
- int TclWinSetSockOpt(int s, int level, int optname,
+ int TclWinSetSockOpt(SOCKET s, int level, int optname,
const char FAR *optval, int optlen)
}
declare 8 win {
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index 4af7895..cae5e4e 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIntDecls.h,v 1.146 2010/11/30 18:17:26 hobbs Exp $
+ * RCS: @(#) $Id: tclIntDecls.h,v 1.147 2010/12/10 15:44:53 nijtmans Exp $
*/
#ifndef _TCLINTDECLS
@@ -265,7 +265,7 @@ EXTERN void TclSetupEnv(Tcl_Interp *interp);
EXTERN int TclSockGetPort(Tcl_Interp *interp, const char *str,
const char *proto, int *portPtr);
/* 104 */
-EXTERN int TclSockMinimumBuffers(int sock, int size);
+EXTERN int TclSockMinimumBuffers(ClientData sock, int size);
/* Slot 105 is reserved */
/* Slot 106 is reserved */
/* Slot 107 is reserved */
@@ -709,7 +709,7 @@ typedef struct TclIntStubs {
CONST86 char * (*tclSetPreInitScript) (const char *string); /* 101 */
void (*tclSetupEnv) (Tcl_Interp *interp); /* 102 */
int (*tclSockGetPort) (Tcl_Interp *interp, const char *str, const char *proto, int *portPtr); /* 103 */
- int (*tclSockMinimumBuffers) (int sock, int size); /* 104 */
+ int (*tclSockMinimumBuffers) (ClientData sock, int size); /* 104 */
void (*reserved105)(void);
void (*reserved106)(void);
void (*reserved107)(void);
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index 95a6016..b15dd84 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -9,7 +9,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.44 2010/08/21 16:30:26 nijtmans Exp $
+ * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.45 2010/12/10 15:44:53 nijtmans Exp $
*/
#ifndef _TCLINTPLATDECLS
@@ -86,7 +86,7 @@ EXTERN void TclWinConvertWSAError(unsigned long errCode);
EXTERN struct servent * TclWinGetServByName(const char *nm,
const char *proto);
/* 3 */
-EXTERN int TclWinGetSockOpt(int s, int level, int optname,
+EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname,
char FAR *optval, int FAR *optlen);
/* 4 */
EXTERN HINSTANCE TclWinGetTclInstance(void);
@@ -94,7 +94,7 @@ EXTERN HINSTANCE TclWinGetTclInstance(void);
/* 6 */
EXTERN u_short TclWinNToHS(u_short ns);
/* 7 */
-EXTERN int TclWinSetSockOpt(int s, int level, int optname,
+EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
const char FAR *optval, int optlen);
/* 8 */
EXTERN unsigned long TclpGetPid(Tcl_Pid pid);
@@ -227,11 +227,11 @@ typedef struct TclIntPlatStubs {
void (*tclWinConvertError) (unsigned long errCode); /* 0 */
void (*tclWinConvertWSAError) (unsigned long errCode); /* 1 */
struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
- int (*tclWinGetSockOpt) (int s, int level, int optname, char FAR *optval, int FAR *optlen); /* 3 */
+ int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char FAR *optval, int FAR *optlen); /* 3 */
HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */
void (*reserved5)(void);
u_short (*tclWinNToHS) (u_short ns); /* 6 */
- int (*tclWinSetSockOpt) (int s, int level, int optname, const char FAR *optval, int optlen); /* 7 */
+ int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, const char FAR *optval, int optlen); /* 7 */
unsigned long (*tclpGetPid) (Tcl_Pid pid); /* 8 */
int (*tclWinGetPlatformId) (void); /* 9 */
void (*reserved10)(void);