summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--generic/tclIOSock.c17
-rw-r--r--generic/tclInt.decls8
-rw-r--r--generic/tclIntDecls.h6
-rw-r--r--generic/tclIntPlatDecls.h10
-rw-r--r--unix/tclUnixSock.c6
-rwxr-xr-xwin/configure278
-rw-r--r--win/configure.in33
-rw-r--r--win/tcl.m47
-rw-r--r--win/tclWinSock.c20
10 files changed, 358 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index afc4c7e..d371790 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,15 @@
* generic/tclIndexObj.c:
* generic/tclIOCmd.c:
* generic/tclVar.c:
+ * win/tcl.m4: Fix manifest-generation for 64-bit gcc (mingw-w64)
+ * win/configure.in: Check for availability of intptr_t and uintptr_t
+ * win/configure: (autoconf-2.59)
+ * generic/tclInt.decls: Change first parameter of TclSockMinimumBuffers to
+ * generic/tclIntDecls.h: ClientData, and TclWin(Get|Set)SockOpt to SOCKET,
+ * generic/tclIntPlatDecls.h:because on Win64 those are 64-bit, which does not fit.
+ * generic/tclIOSock.c:
+ * win/tclWinSock.c:
+ * unix/tclUnixSock.c:
2010-12-09 Donal K. Fellows <dkf@users.sf.net>
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);
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index b3461e3..9e86a6a 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.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: tclUnixSock.c,v 1.31 2010/10/28 16:22:37 dgp Exp $
+ * RCS: @(#) $Id: tclUnixSock.c,v 1.32 2010/12/10 15:44:54 nijtmans Exp $
*/
#include "tclInt.h"
@@ -923,7 +923,7 @@ CreateClientSocket(
* Set kernel space buffering
*/
- TclSockMinimumBuffers(sock, SOCKET_BUFSIZE);
+ TclSockMinimumBuffers(INT2PTR(sock), SOCKET_BUFSIZE);
if (async) {
status = TclUnixSetBlockingMode(sock, TCL_MODE_NONBLOCKING);
@@ -1185,7 +1185,7 @@ Tcl_OpenTcpServer(
* Set kernel space buffering
*/
- TclSockMinimumBuffers(sock, SOCKET_BUFSIZE);
+ TclSockMinimumBuffers(INT2PTR(sock), SOCKET_BUFSIZE);
/*
* Set up to reuse server addresses automatically and bind to the
diff --git a/win/configure b/win/configure
index 0037de6..32d9310 100755
--- a/win/configure
+++ b/win/configure
@@ -4179,8 +4179,11 @@ echo "$as_me: error: ${CC} does not support the -shared option.
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
LDFLAGS_WINDOW="-mwindows ${extra_ldflags}"
- # gcc under Windows supports only 32bit builds
- MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ MACHINE="AMD64"
+ else
+ MACHINE="X86"
+ fi
else
if test "${SHARED_BUILD}" = "0" ; then
# static
@@ -4546,6 +4549,277 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
+echo "$as_me:$LINENO: checking for intptr_t" >&5
+echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_intptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((intptr_t *) 0)
+ return 0;
+if (sizeof (intptr_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_intptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_intptr_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_intptr_t" >&6
+if test $ac_cv_type_intptr_t = yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INTPTR_T 1
+_ACEOF
+
+else
+
+ echo "$as_me:$LINENO: checking for pointer-size signed integer type" >&5
+echo $ECHO_N "checking for pointer-size signed integer type... $ECHO_C" >&6
+if test "${tcl_cv_intptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ for tcl_cv_intptr_t in "int" "long" "long long" none; do
+ if test "$tcl_cv_intptr_t" != none; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_intptr_t))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_ok=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_ok=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$tcl_ok" = yes && break; fi
+ done
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_intptr_t" >&5
+echo "${ECHO_T}$tcl_cv_intptr_t" >&6
+ if test "$tcl_cv_intptr_t" != none; then
+
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $tcl_cv_intptr_t
+_ACEOF
+
+ fi
+
+fi
+
+echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintptr_t *) 0)
+ return 0;
+if (sizeof (uintptr_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_uintptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintptr_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
+if test $ac_cv_type_uintptr_t = yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+else
+
+ echo "$as_me:$LINENO: checking for pointer-size unsigned integer type" >&5
+echo $ECHO_N "checking for pointer-size unsigned integer type... $ECHO_C" >&6
+if test "${tcl_cv_uintptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \
+ none; do
+ if test "$tcl_cv_uintptr_t" != none; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_uintptr_t))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_ok=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_ok=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$tcl_ok" = yes && break; fi
+ done
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_uintptr_t" >&5
+echo "${ECHO_T}$tcl_cv_uintptr_t" >&6
+ if test "$tcl_cv_uintptr_t" != none; then
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $tcl_cv_uintptr_t
+_ACEOF
+
+ fi
+
+fi
+
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
# option. This macro depends on C flags, and should be called
diff --git a/win/configure.in b/win/configure.in
index f5cdebb..3ffe9f2 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -3,7 +3,7 @@
# generate the file "configure", which is run during Tcl installation
# to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.126 2010/12/03 09:19:39 nijtmans Exp $
+# RCS: @(#) $Id: configure.in,v 1.127 2010/12/10 15:44:53 nijtmans Exp $
AC_INIT(../generic/tcl.h)
AC_PREREQ(2.59)
@@ -340,6 +340,37 @@ AS_IF([test "$tcl_ok" = "yes"], [
])
AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])
+AC_CHECK_TYPE([intptr_t], [
+ AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [
+ AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [
+ for tcl_cv_intptr_t in "int" "long" "long long" none; do
+ if test "$tcl_cv_intptr_t" != none; then
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
+ [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])],
+ [tcl_ok=yes], [tcl_ok=no])
+ test "$tcl_ok" = yes && break; fi
+ done])
+ if test "$tcl_cv_intptr_t" != none; then
+ AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer
+ type wide enough to hold a pointer.])
+ fi
+])
+AC_CHECK_TYPE([uintptr_t], [
+ AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [
+ AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [
+ for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \
+ none; do
+ if test "$tcl_cv_uintptr_t" != none; then
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
+ [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])],
+ [tcl_ok=yes], [tcl_ok=no])
+ test "$tcl_ok" = yes && break; fi
+ done])
+ if test "$tcl_cv_uintptr_t" != none; then
+ AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer
+ type wide enough to hold a pointer.])
+ fi
+])
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
# option. This macro depends on C flags, and should be called
diff --git a/win/tcl.m4 b/win/tcl.m4
index c24171c..601f3e2 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -575,8 +575,11 @@ file for information about building with Mingw.])
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
LDFLAGS_WINDOW="-mwindows ${extra_ldflags}"
- # gcc under Windows supports only 32bit builds
- MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ MACHINE="AMD64"
+ else
+ MACHINE="X86"
+ fi
else
if test "${SHARED_BUILD}" = "0" ; then
# static
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 347aa1c..5407b47 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.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: tclWinSock.c,v 1.79 2010/10/26 13:59:28 dkf Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.80 2010/12/10 15:44:53 nijtmans Exp $
*
* -----------------------------------------------------------------------
*
@@ -1062,7 +1062,7 @@ CreateSocket(
* Set kernel space buffering
*/
- TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE);
+ TclSockMinimumBuffers((ClientData)sock, TCP_BUFFER_SIZE);
/*
* Make sure we use the same port when opening two server sockets
@@ -1171,7 +1171,7 @@ CreateSocket(
* Set kernel space buffering
*/
- TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE);
+ TclSockMinimumBuffers((ClientData)sock, TCP_BUFFER_SIZE);
/*
* Try to bind to a local port.
@@ -1508,7 +1508,7 @@ Tcl_MakeTcpClientChannel(
* Set kernel space buffering and non-blocking.
*/
- TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE);
+ TclSockMinimumBuffers((ClientData) sock, TCP_BUFFER_SIZE);
infoPtr = NewSocketInfo((SOCKET) sock);
@@ -2095,7 +2095,7 @@ TcpGetOptionProc(
}
infoPtr = (SocketInfo *) instanceData;
- sock = (int) infoPtr->sockets->fd;
+ sock = infoPtr->sockets->fd;
if (optionName != NULL) {
len = strlen(optionName);
}
@@ -2107,7 +2107,7 @@ TcpGetOptionProc(
int ret;
optlen = sizeof(int);
- ret = TclWinGetSockOpt((int)sock, SOL_SOCKET, SO_ERROR,
+ ret = TclWinGetSockOpt(sock, SOL_SOCKET, SO_ERROR,
(char *)&err, &optlen);
if (ret == SOCKET_ERROR) {
err = WSAGetLastError();
@@ -2686,7 +2686,7 @@ InitializeHostName(
int
TclWinGetSockOpt(
- int s,
+ SOCKET s,
int level,
int optname,
char * optval,
@@ -2702,12 +2702,12 @@ TclWinGetSockOpt(
return SOCKET_ERROR;
}
- return getsockopt((SOCKET)s, level, optname, optval, optlen);
+ return getsockopt(s, level, optname, optval, optlen);
}
int
TclWinSetSockOpt(
- int s,
+ SOCKET s,
int level,
int optname,
const char * optval,
@@ -2723,7 +2723,7 @@ TclWinSetSockOpt(
return SOCKET_ERROR;
}
- return setsockopt((SOCKET)s, level, optname, optval, optlen);
+ return setsockopt(s, level, optname, optval, optlen);
}
u_short