From 470dc679b3ef5fad8fa57ec1e90b9f13b676c229 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 11 Jul 2012 17:09:44 +0000 Subject: Release candidate branch for Tcl 8.6b3. --- README | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- tools/tcl.wse.in | 2 +- unix/configure | 2 +- unix/configure.in | 2 +- unix/tcl.spec | 2 +- win/configure | 2 +- win/configure.in | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README b/README index 0442a0e..56f7e38 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tcl - This is the Tcl 8.6b2 source distribution. + This is the Tcl 8.6b3 source distribution. http://tcl.sourceforge.net/ You can get any source release of Tcl from the file distributions link at the above URL. diff --git a/generic/tcl.h b/generic/tcl.h index 729e521..32d8e1e 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -58,10 +58,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 6 #define TCL_RELEASE_LEVEL TCL_BETA_RELEASE -#define TCL_RELEASE_SERIAL 2 +#define TCL_RELEASE_SERIAL 3 #define TCL_VERSION "8.6" -#define TCL_PATCH_LEVEL "8.6b2" +#define TCL_PATCH_LEVEL "8.6b3" /* *---------------------------------------------------------------------------- diff --git a/library/init.tcl b/library/init.tcl index d8de540..e4b14d2 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -15,7 +15,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.6b2 +package require -exact Tcl 8.6b3 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/tools/tcl.wse.in b/tools/tcl.wse.in index 653b1e1..77beb41 100644 --- a/tools/tcl.wse.in +++ b/tools/tcl.wse.in @@ -12,7 +12,7 @@ item: Global Log Pathname=%MAINDIR%\INSTALL.LOG Message Font=MS Sans Serif Font Size=8 - Disk Label=tcl8.6b2 + Disk Label=tcl8.6b3 Disk Filename=setup Patch Flags=0000000000000001 Patch Threshold=85 diff --git a/unix/configure b/unix/configure index 2e36ad2..0b8bc82 100755 --- a/unix/configure +++ b/unix/configure @@ -1335,7 +1335,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL="b2" +TCL_PATCH_LEVEL="b3" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ diff --git a/unix/configure.in b/unix/configure.in index 79a546d..beff4a3 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL="b2" +TCL_PATCH_LEVEL="b3" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ diff --git a/unix/tcl.spec b/unix/tcl.spec index b35e220..0c42aa4 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 8.6b2 +Version: 8.6b3 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index fed0959..04a5e90 100755 --- a/win/configure +++ b/win/configure @@ -1311,7 +1311,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL="b2" +TCL_PATCH_LEVEL="b3" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.in b/win/configure.in index 2377938..ae91a0a 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL="b2" +TCL_PATCH_LEVEL="b3" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From ff0e2463cb108f9b0481ac516251142506818114 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 12 Jul 2012 10:54:48 +0000 Subject: Update TclOO package to 0.7, correct copyright dates. --- generic/tclOO.c | 2 +- generic/tclOO.h | 5 +++-- generic/tclOOBasic.c | 2 +- generic/tclOOCall.c | 2 +- generic/tclOODefineCmds.c | 2 +- generic/tclOOInfo.c | 2 +- generic/tclOOInt.h | 2 +- generic/tclOOMethod.c | 2 +- tests/oo.test | 4 ++-- tests/ooNext2.test | 10 ++++------ unix/tclooConfig.sh | 2 +- win/tclooConfig.sh | 2 +- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 821befd..47544f2 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -3,7 +3,7 @@ * * This file contains the object-system core (NB: not Tcl_Obj, but ::oo) * - * Copyright (c) 2005-2011 by Donal K. Fellows + * Copyright (c) 2005-2012 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tclOO.h b/generic/tclOO.h index fef2bd0..280481c 100644 --- a/generic/tclOO.h +++ b/generic/tclOO.h @@ -4,7 +4,7 @@ * This file contains the public API definitions and some of the function * declarations for the object-system (NB: not Tcl_Obj, but ::oo). * - * Copyright (c) 2006-2008 by Donal K. Fellows + * Copyright (c) 2006-2010 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -34,11 +34,12 @@ extern const char *TclOOInitializeStubs( * version in the files: * * tests/oo.test + * tests/ooNext2.test * unix/tclooConfig.sh * win/tclooConfig.sh */ -#define TCLOO_VERSION "0.6.3" +#define TCLOO_VERSION "0.7" #define TCLOO_PATCHLEVEL TCLOO_VERSION /* diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index 35ad1eb..fb1ebc2 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -4,7 +4,7 @@ * This file contains implementations of the "simple" commands and * methods from the object-system core. * - * Copyright (c) 2005-2011 by Donal K. Fellows + * Copyright (c) 2005-2012 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 760bd7b..a79e4fa 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -4,7 +4,7 @@ * This file contains the method call chain management code for the * object-system core. * - * Copyright (c) 2005-2011 by Donal K. Fellows + * Copyright (c) 2005-2012 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 69cffb0..b95681c 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -4,7 +4,7 @@ * This file contains the implementation of the ::oo::define command, * part of the object-system core (NB: not Tcl_Obj, but ::oo). * - * Copyright (c) 2006-2008 by Donal K. Fellows + * Copyright (c) 2006-2012 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index f298320..c27a1cc 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -4,7 +4,7 @@ * This file contains the implementation of the ::oo-related [info] * subcommands. * - * Copyright (c) 2006-2008 by Donal K. Fellows + * Copyright (c) 2006-2011 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 631961f..ab54964 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -4,7 +4,7 @@ * This file contains the structure definitions and some of the function * declarations for the object-system (NB: not Tcl_Obj, but ::oo). * - * Copyright (c) 2006-2011 by Donal K. Fellows + * Copyright (c) 2006-2012 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 877c3db..f735853 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -3,7 +3,7 @@ * * This file contains code to create and manage methods. * - * Copyright (c) 2005-2008 by Donal K. Fellows + * Copyright (c) 2005-2011 by Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/tests/oo.test b/tests/oo.test index 00663e9..540cdf3 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -2,12 +2,12 @@ # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # -# Copyright (c) 2006-2011 Donal K. Fellows +# Copyright (c) 2006-2012 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require -exact TclOO 0.6.3 ;# Must match value in generic/tclOO.h +package require -exact TclOO 0.7 ;# Must match value in generic/tclOO.h package require tcltest 2 if {"::tcltest" in [namespace children]} { namespace import -force ::tcltest::* diff --git a/tests/ooNext2.test b/tests/ooNext2.test index eeade11..e78e0d0 100644 --- a/tests/ooNext2.test +++ b/tests/ooNext2.test @@ -2,16 +2,14 @@ # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # -# Copyright (c) 2006-2008 Donal K. Fellows +# Copyright (c) 2006-2011 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: oo.test,v 1.59 2011/01/18 16:10:48 dkf Exp $ -package require -exact TclOO 0.6.3 ;# Must match value in configure.in -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest 2 +package require -exact TclOO 0.7 ;# Must match value in configure.in +package require tcltest 2 +if {"::tcltest" in [namespace children]} { namespace import -force ::tcltest::* } diff --git a/unix/tclooConfig.sh b/unix/tclooConfig.sh index 68de106..dce540a 100644 --- a/unix/tclooConfig.sh +++ b/unix/tclooConfig.sh @@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS=-DUSE_TCLOO_STUBS -TCLOO_VERSION=0.6.3 +TCLOO_VERSION=0.7 diff --git a/win/tclooConfig.sh b/win/tclooConfig.sh index 68de106..dce540a 100644 --- a/win/tclooConfig.sh +++ b/win/tclooConfig.sh @@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS=-DUSE_TCLOO_STUBS -TCLOO_VERSION=0.6.3 +TCLOO_VERSION=0.7 -- cgit v0.12 From ff601c88100652c703080ff83ba89801e0ea0aba Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 16 Jul 2012 20:31:44 +0000 Subject: [Bug 3496014]: Unecessary memset() in Tcl_SetByteArrayObj() --- generic/tclBinary.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 444e7fa..ae8172f 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -307,12 +307,8 @@ Tcl_SetByteArrayObj( byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length)); byteArrayPtr->used = length; byteArrayPtr->allocated = length; - if (length) { - if (bytes) { - memcpy(byteArrayPtr->bytes, bytes, (size_t) length); - } else { - memset(byteArrayPtr->bytes, 0, (size_t) length); - } + if (length && bytes) { + memcpy(byteArrayPtr->bytes, bytes, (size_t) length); } objPtr->typePtr = &tclByteArrayType; -- cgit v0.12 From e47ba9f0c364c577be35a2cc155d90078742a2d7 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 19 Jul 2012 10:54:13 +0000 Subject: [Bug: 3545363]: Use a large enough buffer for accept()ing IPv6 connections. Fix conversion of host and port for passing to the accept proc to be independent of the IP version. --- ChangeLog | 7 +++++++ win/tclWinSock.c | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 427b3e4..b726d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-07-19 Reinhard Max + + * win/tclWinSock.c (TcpAccept): [Bug: 3545363]: Use a large enough + buffer for accept()ing IPv6 connections. Fix conversion of host + and port for passing to the accept proc to be independent of the + IP version. + 2012-07-17 Jan Nijtmans * win/makefile.vc: [Bug 3544932]: Visual studio compiler check fails diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 97b10a3..5603ef3 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1556,18 +1556,19 @@ TcpAccept( SOCKET newSocket; SocketInfo *newInfoPtr; SocketInfo *infoPtr = fds->infoPtr; - SOCKADDR_IN addr; + address addr; int len; char channelName[16 + TCL_INTEGER_SPACE]; + char host[NI_MAXHOST], port[NI_MAXSERV]; ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey); /* * Accept the incoming connection request. */ - len = sizeof(SOCKADDR_IN); + len = sizeof(address); - newSocket = accept(fds->fd, (SOCKADDR *) &addr, &len); + newSocket = accept(fds->fd, &(addr.sa), &len); /* * Protect access to sockets (acceptEventCount, readyEvents) in socketList @@ -1644,8 +1645,10 @@ TcpAccept( */ if (infoPtr->acceptProc != NULL) { + getnameinfo(&(addr.sa), len, host, sizeof(host), port, sizeof(port), + NI_NUMERICHOST|NI_NUMERICSERV); infoPtr->acceptProc(infoPtr->acceptProcData, newInfoPtr->channel, - inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); + host, atoi(port)); } } -- cgit v0.12 From e574cc448ea3a74b469753686dbe9e2c5ac90037 Mon Sep 17 00:00:00 2001 From: twylite Date: Tue, 24 Jul 2012 13:58:44 +0000 Subject: [Bug: 3545363]: Handle socket with multiple underlying file descriptors where required (TcpCloseProc, SocketProc). Refactor socket/descriptor setup. Fix memory leak in socket close (TcpCloseProc) and related dangling pointers in SocketEventProc. --- win/tclWinSock.c | 307 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 187 insertions(+), 120 deletions(-) diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 5603ef3..c651deb 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -220,7 +220,7 @@ static void SocketExitHandler(ClientData clientData); static LRESULT CALLBACK SocketProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); static int SocketsEnabled(void); -static void TcpAccept(TcpFdList *fds); +static void TcpAccept(TcpFdList *fds, SOCKET newSocket, address addr); static int WaitForSocketEvent(SocketInfo *infoPtr, int events, int *errorCodePtr); static DWORD WINAPI SocketThread(LPVOID arg); @@ -692,6 +692,9 @@ SocketEventProc( int mask = 0, events; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); TcpFdList *fds; + SOCKET newSocket; + address addr; + int len; if (!(flags & TCL_FILE_EVENTS)) { return 0; @@ -708,13 +711,13 @@ SocketEventProc( break; } } - SetEvent(tsdPtr->socketListLock); /* * Discard events that have gone stale. */ if (!infoPtr) { + SetEvent(tsdPtr->socketListLock); return 1; } @@ -726,11 +729,65 @@ SocketEventProc( if (infoPtr->readyEvents & FD_ACCEPT) { for (fds = infoPtr->sockets; fds != NULL; fds = fds->next) { - TcpAccept(fds); + + /* + * Accept the incoming connection request. + */ + len = sizeof(address); + + newSocket = accept(fds->fd, &(addr.sa), &len); + + /* On Tcl server sockets with multiple OS fds we loop over the fds trying + * an accept() on each, so we expect INVALID_SOCKET. There are also other + * network stack conditions that can result in FD_ACCEPT but a subsequent + * failure on accept() by the time we get around to it. + * Access to sockets (acceptEventCount, readyEvents) in socketList + * is still protected by the lock (prevents reintroduction of + * SF Tcl Bug 3056775. + */ + + if (newSocket == INVALID_SOCKET) { + /* int err = WSAGetLastError(); */ + continue; + } + + /* + * It is possible that more than one FD_ACCEPT has been sent, so an extra + * count must be kept. Decrement the count, and reset the readyEvent bit + * if the count is no longer > 0. + */ + infoPtr->acceptEventCount--; + + if (infoPtr->acceptEventCount <= 0) { + infoPtr->readyEvents &= ~(FD_ACCEPT); + } + + SetEvent(tsdPtr->socketListLock); + + /* Caution: TcpAccept() has the side-effect of evaluating the server + * accept script (via AcceptCallbackProc() in tclIOCmd.c), which can + * close the server socket and invalidate infoPtr and fds. + * If TcpAccept() accepts a socket we must return immediately and let + * SocketCheckProc queue additional FD_ACCEPT events. + */ + TcpAccept(fds, newSocket, addr); + return 1; } + + /* Loop terminated with no sockets accepted; clear the ready mask so + * we can detect the next connection request. Note that connection + * requests are level triggered, so if there is a request already + * pending, a new event will be generated. + */ + infoPtr->acceptEventCount = 0; + infoPtr->readyEvents &= ~(FD_ACCEPT); + + SetEvent(tsdPtr->socketListLock); return 1; } + SetEvent(tsdPtr->socketListLock); + /* * Mask off unwanted events and compute the read/write mask so we can * notify the channel. @@ -872,9 +929,15 @@ TcpCloseProc( * background. */ - if (closesocket(infoPtr->sockets->fd) == SOCKET_ERROR) { - TclWinConvertError((DWORD) WSAGetLastError()); - errorCode = Tcl_GetErrno(); + while ( infoPtr->sockets != NULL ) { + TcpFdList *thisfd = infoPtr->sockets; + infoPtr->sockets = thisfd->next; + + if (closesocket(thisfd->fd) == SOCKET_ERROR) { + TclWinConvertError((DWORD) WSAGetLastError()); + errorCode = Tcl_GetErrno(); + } + ckfree(thisfd); } } @@ -934,6 +997,8 @@ TcpClose2Proc( return TCL_ERROR; } + /* single fd operation: Tcl_OpenTcpServer() does not set TCL_READABLE or + * TCL_WRITABLE so this should never be called for a server socket. */ if (shutdown(infoPtr->sockets->fd, sd) == SOCKET_ERROR) { TclWinConvertError((DWORD) WSAGetLastError()); errorCode = Tcl_GetErrno(); @@ -945,6 +1010,51 @@ TcpClose2Proc( /* *---------------------------------------------------------------------- * + * AddSocketInfoFd -- + * + * This function adds a SOCKET file descriptor to the 'sockets' linked + * list of a SocketInfo structure. + * + * Results: + * None. + * + * Side effects: + * None, except for allocation of memory. + * + *---------------------------------------------------------------------- + */ + +static void +AddSocketInfoFd( + SocketInfo *infoPtr, + SOCKET socket) +{ + TcpFdList *fds = infoPtr->sockets; + + if ( fds == NULL ) { + /* Add the first FD */ + infoPtr->sockets = ckalloc(sizeof(TcpFdList)); + fds = infoPtr->sockets; + } else { + /* Find end of list and append FD */ + while ( fds->next != NULL ) { + fds = fds->next; + } + + fds->next = ckalloc(sizeof(TcpFdList)); + fds = fds->next; + } + + /* Populate new FD */ + fds->fd = socket; + fds->infoPtr = infoPtr; + fds->next = NULL; +} + + +/* + *---------------------------------------------------------------------- + * * NewSocketInfo -- * * This function allocates and initializes a new SocketInfo structure. @@ -963,14 +1073,10 @@ NewSocketInfo( SOCKET socket) { SocketInfo *infoPtr = ckalloc(sizeof(SocketInfo)); - TcpFdList *fds = ckalloc(sizeof(TcpFdList)); - fds->fd = socket; - fds->next = NULL; - fds->infoPtr = infoPtr; /* ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); */ infoPtr->channel = 0; - infoPtr->sockets = fds; + infoPtr->sockets = NULL; infoPtr->flags = 0; infoPtr->watchEvents = 0; infoPtr->readyEvents = 0; @@ -988,6 +1094,8 @@ NewSocketInfo( infoPtr->nextPtr = NULL; + AddSocketInfoFd(infoPtr, socket); + return infoPtr; } @@ -1057,7 +1165,6 @@ CreateSocket( } if (server) { - TcpFdList *fds = NULL, *newfds; for (addrPtr = addrlist; addrPtr != NULL; addrPtr = addrPtr->ai_next) { sock = socket(addrPtr->ai_family, SOCK_STREAM, 0); @@ -1140,7 +1247,6 @@ CreateSocket( */ infoPtr = NewSocketInfo(sock); - fds = infoPtr->sockets; /* * Set up the select mask for connection request events. @@ -1150,13 +1256,7 @@ CreateSocket( infoPtr->watchEvents |= FD_ACCEPT; } else { - newfds = ckalloc(sizeof(TcpFdList)); - memset(newfds, (int) 0, sizeof(TcpFdList)); - newfds->fd = sock; - newfds->infoPtr = infoPtr; - newfds->next = NULL; - fds->next = newfds; - fds = newfds; + AddSocketInfoFd( infoPtr, sock ); } } } else { @@ -1537,8 +1637,9 @@ Tcl_OpenTcpServer( * * TcpAccept -- * - * Accept a TCP socket connection. This is called by SocketEventProc and - * it in turns calls the registered accept function. + * Creates a channel for a newly accepted socket connection. This is + * called by SocketEventProc and it in turns calls the registered + * accept function. * * Results: * None. @@ -1551,61 +1652,18 @@ Tcl_OpenTcpServer( static void TcpAccept( - TcpFdList *fds) /* Socket to accept. */ + TcpFdList *fds, /* Server socket that accepted newSocket. */ + SOCKET newSocket, /* Newly accepted socket. */ + address addr) /* Address of new socket. */ { - SOCKET newSocket; SocketInfo *newInfoPtr; SocketInfo *infoPtr = fds->infoPtr; - address addr; - int len; + int len = sizeof(addr); char channelName[16 + TCL_INTEGER_SPACE]; char host[NI_MAXHOST], port[NI_MAXSERV]; ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey); /* - * Accept the incoming connection request. - */ - - len = sizeof(address); - - newSocket = accept(fds->fd, &(addr.sa), &len); - - /* - * Protect access to sockets (acceptEventCount, readyEvents) in socketList - * by the lock. Fix for SF Tcl Bug 3056775. - */ - - WaitForSingleObject(tsdPtr->socketListLock, INFINITE); - - /* - * Clear the ready mask so we can detect the next connection request. Note - * that connection requests are level triggered, so if there is a request - * already pending, a new event will be generated. - */ - - if (newSocket == INVALID_SOCKET) { - infoPtr->acceptEventCount = 0; - infoPtr->readyEvents &= ~(FD_ACCEPT); - - SetEvent(tsdPtr->socketListLock); - return; - } - - /* - * It is possible that more than one FD_ACCEPT has been sent, so an extra - * count must be kept. Decrement the count, and reset the readyEvent bit - * if the count is no longer > 0. - */ - - infoPtr->acceptEventCount--; - - if (infoPtr->acceptEventCount <= 0) { - infoPtr->readyEvents &= ~(FD_ACCEPT); - } - - SetEvent(tsdPtr->socketListLock); - - /* * Win-NT has a misfeature that sockets are inherited in child processes * by default. Turn off the inherit bit. */ @@ -1648,7 +1706,7 @@ TcpAccept( getnameinfo(&(addr.sa), len, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST|NI_NUMERICSERV); infoPtr->acceptProc(infoPtr->acceptProcData, newInfoPtr->channel, - host, atoi(port)); + host, atoi(port)); } } @@ -1723,6 +1781,7 @@ TcpInputProc( while (1) { SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) UNSELECT, (LPARAM) infoPtr); + /* single fd operation: this proc is only called for a connected socket. */ bytesRead = recv(infoPtr->sockets->fd, buf, toRead, 0); infoPtr->readyEvents &= ~(FD_READ); @@ -1843,6 +1902,7 @@ TcpOutputProc( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) UNSELECT, (LPARAM) infoPtr); + /* single fd operation: this proc is only called for a connected socket. */ bytesWritten = send(infoPtr->sockets->fd, buf, toWrite, 0); if (bytesWritten != SOCKET_ERROR) { /* @@ -1938,6 +1998,7 @@ TcpSetOptionProc( } #ifdef TCL_FEATURE_KEEPALIVE_NAGLE + #error "TCL_FEATURE_KEEPALIVE_NAGLE not reviewed for whether to treat infoPtr->sockets as single fd or list" sock = infoPtr->sockets->fd; if (!strcasecmp(optionName, "-keepalive")) { @@ -2401,6 +2462,7 @@ SocketProc( int event, error; SOCKET socket; SocketInfo *infoPtr; + TcpFdList *fds = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) #ifdef _WIN64 GetWindowLongPtr(hwnd, GWLP_USERDATA); @@ -2445,58 +2507,60 @@ SocketProc( WaitForSingleObject(tsdPtr->socketListLock, INFINITE); for (infoPtr = tsdPtr->socketList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { - if (infoPtr->sockets->fd == socket) { - /* - * Update the socket state. - * - * A count of FD_ACCEPTS is stored, so if an FD_CLOSE event - * happens, then clear the FD_ACCEPT count. Otherwise, - * increment the count if the current event is an FD_ACCEPT. - */ - - if (event & FD_CLOSE) { - infoPtr->acceptEventCount = 0; - infoPtr->readyEvents &= ~(FD_WRITE|FD_ACCEPT); - } else if (event & FD_ACCEPT) { - infoPtr->acceptEventCount++; - } - - if (event & FD_CONNECT) { + for (fds = infoPtr->sockets; fds != NULL; fds = fds->next) { + if (fds->fd == socket) { /* - * The socket is now connected, clear the async connect - * flag. + * Update the socket state. + * + * A count of FD_ACCEPTS is stored, so if an FD_CLOSE event + * happens, then clear the FD_ACCEPT count. Otherwise, + * increment the count if the current event is an FD_ACCEPT. */ - infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); + if (event & FD_CLOSE) { + infoPtr->acceptEventCount = 0; + infoPtr->readyEvents &= ~(FD_WRITE|FD_ACCEPT); + } else if (event & FD_ACCEPT) { + infoPtr->acceptEventCount++; + } - /* - * Remember any error that occurred so we can report - * connection failures. - */ + if (event & FD_CONNECT) { + /* + * The socket is now connected, clear the async connect + * flag. + */ + + infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); - if (error != ERROR_SUCCESS) { - TclWinConvertError((DWORD) error); - infoPtr->lastError = Tcl_GetErrno(); + /* + * Remember any error that occurred so we can report + * connection failures. + */ + + if (error != ERROR_SUCCESS) { + TclWinConvertError((DWORD) error); + infoPtr->lastError = Tcl_GetErrno(); + } } - } - if (infoPtr->flags & SOCKET_ASYNC_CONNECT) { - infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); - if (error != ERROR_SUCCESS) { - TclWinConvertError((DWORD) error); - infoPtr->lastError = Tcl_GetErrno(); + if (infoPtr->flags & SOCKET_ASYNC_CONNECT) { + infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); + if (error != ERROR_SUCCESS) { + TclWinConvertError((DWORD) error); + infoPtr->lastError = Tcl_GetErrno(); + } + infoPtr->readyEvents |= FD_WRITE; } - infoPtr->readyEvents |= FD_WRITE; - } - infoPtr->readyEvents |= event; + infoPtr->readyEvents |= event; - /* - * Wake up the Main Thread. - */ + /* + * Wake up the Main Thread. + */ - SetEvent(tsdPtr->readyEvent); - Tcl_ThreadAlert(tsdPtr->threadId); - break; + SetEvent(tsdPtr->readyEvent); + Tcl_ThreadAlert(tsdPtr->threadId); + break; + } } } SetEvent(tsdPtr->socketListLock); @@ -2504,15 +2568,18 @@ SocketProc( case SOCKET_SELECT: infoPtr = (SocketInfo *) lParam; - if (wParam == SELECT) { - WSAAsyncSelect(infoPtr->sockets->fd, hwnd, - SOCKET_MESSAGE, infoPtr->selectEvents); - } else { - /* - * Clear the selection mask - */ + for (fds = infoPtr->sockets; fds != NULL; fds = fds->next) { + infoPtr = (SocketInfo *) lParam; + if (wParam == SELECT) { + WSAAsyncSelect(fds->fd, hwnd, + SOCKET_MESSAGE, infoPtr->selectEvents); + } else { + /* + * Clear the selection mask + */ - WSAAsyncSelect(infoPtr->sockets->fd, hwnd, 0, 0); + WSAAsyncSelect(fds->fd, hwnd, 0, 0); + } } break; -- cgit v0.12 From 0a213115cc2d64e0bf3608839b2b3f079e89c04e Mon Sep 17 00:00:00 2001 From: twylite Date: Mon, 30 Jul 2012 14:01:35 +0000 Subject: Updated ChangeLog for changes in [7a82c3e6] --- ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index b726d9c..2ed0d85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-07-24 Trevor Davel + + * win/tclWinSock.c: [Bug: 3545363]: Loop over multiple underlying file + descriptors for a socket where required (TcpCloseProc, SocketProc). Refactor + socket/descriptor setup to manage linked list operations in one place. Fix + memory leak in socket close (TcpCloseProc) and related dangling pointers in + SocketEventProc. + 2012-07-19 Reinhard Max * win/tclWinSock.c (TcpAccept): [Bug: 3545363]: Use a large enough -- cgit v0.12 From 0062f8538fd9dc925e8b8e00b9ede5ff39022623 Mon Sep 17 00:00:00 2001 From: stwo Date: Wed, 8 Aug 2012 23:07:27 +0000 Subject: Change one '#ifdef' to '#if defined()' for improved consistency within the file. --- ChangeLog | 5 +++++ unix/tclUnixCompat.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cbbfea1..95a67b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-08 Stuart Cassoff + + * unix/tclUnixCompat.c: Change one '#ifdef' to '#if defined()' for + improved consistency within the file. + 2012-08-08 Jan Nijtmans * generic/tclfileName.c: [Bug #1536227]: Cygwin network pathname diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 3818121..359e253 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -364,7 +364,7 @@ TclpGetGrNam( #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); -#ifdef HAVE_GETGRNAM_R_5 +#if defined(HAVE_GETGRNAM_R_5) struct group *grPtr = NULL; /* -- cgit v0.12 From ff7f9ca57976adcf0bd2d12b434e250cbcbbf765 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 9 Aug 2012 14:26:04 +0000 Subject: Fix http-3.29 for machines without IPv6 support. --- ChangeLog | 4 ++++ tests/http.test | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95a67b9..3d6e6d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-08-09 Reinhard Max + + * tests/http.test: Fix http-3.29 for machines without IPv6 support. + 2010-08-08 Stuart Cassoff * unix/tclUnixCompat.c: Change one '#ifdef' to '#if defined()' for diff --git a/tests/http.test b/tests/http.test index fe44b47..bde5795 100644 --- a/tests/http.test +++ b/tests/http.test @@ -392,11 +392,19 @@ Content-Type {text/plain;charset=utf-8} Accept-Encoding .* Content-Length 5} test http-3.29 "http::geturl $ipv6url" -body { - set token [http::geturl $ipv6url -validate 1] - http::code $token + # We only want to see if the URL gets parsed correctly. This is + # the case if http::geturl succeeds or returns a socket related + # error. If the parsing is wrong, we'll get a parse error. + # It'd be better to separate the URL parser from http::geturl, so + # that it can be tested without also trying to make a connection. + set error [catch {http::geturl $ipv6url -validate 1} token] + if {$error && [string match "couldn't open socket: *" $token]} { + set error 0 + } + set error } -cleanup { - http::cleanup $token -} -result "HTTP/1.0 200 OK" + catch { http::cleanup $token } +} -result 0 test http-4.1 {http::Event} -body { set token [http::geturl $url -keepalive 0] -- cgit v0.12 From 6c8d57ffe3737a001786e0838daaf1a6e9f246c1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 13 Aug 2012 04:42:33 +0000 Subject: minor fix --- doc/dde.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dde.n b/doc/dde.n index e4b51b7..0acceac 100644 --- a/doc/dde.n +++ b/doc/dde.n @@ -88,7 +88,7 @@ string is sent. Combining \fB-binary\fR with the result of \fBencoding convertto\fR may be used to send data in arbitrary encodings. .VE 8.6 .TP -\fBdde poke ?\fB\-binary\fR? \fIservice topic item data\fR +\fBdde poke\fR ?\fB\-binary\fR? \fIservice topic item data\fR . \fBdde poke\fR passes the \fIdata\fR to the server indicated by \fIservice\fR using the \fItopic\fR and \fIitem\fR specified. Typically, -- cgit v0.12 From c5e721806345e37d192fc329af24785b5490c08a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 13 Aug 2012 13:58:25 +0000 Subject: Add 64-bit build of zlib1.dll, and use it for the dynamic mingw-w64 build --- ChangeLog | 8 ++++++++ compat/zlib/win64/zdll.lib | Bin 0 -> 45650 bytes compat/zlib/win64/zlib1.dll | Bin 0 -> 112640 bytes win/Makefile.in | 8 ++++++-- win/configure | 14 ++++++++++++-- win/configure.in | 8 ++++++-- 6 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 compat/zlib/win64/zdll.lib create mode 100644 compat/zlib/win64/zlib1.dll diff --git a/ChangeLog b/ChangeLog index 4391648..e1eb9b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-08-13 Jan Nijtmans + + * compat/zlib/win64/zlib1.dll: Add 64-bit build of zlib1.dll, and use it + * compat/zlib/win64/zdll.lib: for the dynamic mingw-w64 build. + * win/Makefile.in + * win/configure.in + * win/configure + 2012-08-09 Reinhard Max * tests/http.test: Fix http-3.29 for machines without IPv6 support. diff --git a/compat/zlib/win64/zdll.lib b/compat/zlib/win64/zdll.lib new file mode 100644 index 0000000..084dbff Binary files /dev/null and b/compat/zlib/win64/zdll.lib differ diff --git a/compat/zlib/win64/zlib1.dll b/compat/zlib/win64/zlib1.dll new file mode 100644 index 0000000..631439b Binary files /dev/null and b/compat/zlib/win64/zlib1.dll differ diff --git a/win/Makefile.in b/win/Makefile.in index 84dcaf7..fbc9274 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -456,8 +456,12 @@ ${TEST_DLL_FILE}: ${TCLTEST_OBJS} ${TCL_STUB_LIB_FILE} @MAKE_DLL@ ${TCLTEST_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) # use pre-built zlib1.dll -${ZLIB_DLL_FILE}: $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} - @$(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE} +${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE} + if test "@ZLIB_LIBS@set" == "${ZLIB_DIR}/win64/zdll.libset" ; then \ + $(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ + else \ + $(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ + fi; # Add the object extension to the implicit rules. By default .obj is not # automatically added. diff --git a/win/configure b/win/configure index f5a23fe..5cf1513 100755 --- a/win/configure +++ b/win/configure @@ -4344,7 +4344,7 @@ esac # as we just assume that the platform hasn't got a usable z.lib #------------------------------------------------------------------------ -if test "$do64bit" = "yes"; then +if test "$do64bit" = "yes" && test "$GCC" != "yes"; then tcl_ok=no @@ -4368,7 +4368,17 @@ if test "$tcl_ok" = "yes"; then ZLIB_DLL_FILE=\${ZLIB_DLL_FILE} - ZLIB_LIBS=\${ZLIB_DIR}/win32/zdll.lib + if test "$do64bit" = "yes"; then + + ZLIB_LIBS=\${ZLIB_DIR}/win64/zdll.lib + + +else + + ZLIB_LIBS=\${ZLIB_DIR}/win32/zdll.lib + + +fi else diff --git a/win/configure.in b/win/configure.in index d17f815..de56bf7 100644 --- a/win/configure.in +++ b/win/configure.in @@ -120,7 +120,7 @@ esac # as we just assume that the platform hasn't got a usable z.lib #------------------------------------------------------------------------ -AS_IF([test "$do64bit" = "yes"], [ +AS_IF([test "$do64bit" = "yes" && test "$GCC" != "yes"], [ tcl_ok=no ], [ AS_IF([test "${enable_shared+set}" = "set"], [ @@ -132,7 +132,11 @@ AS_IF([test "${enable_shared+set}" = "set"], [ ]) AS_IF([test "$tcl_ok" = "yes"], [ AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}]) - AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win32/zdll.lib]) + AS_IF([test "$do64bit" = "yes"], [ + AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win64/zdll.lib]) + ], [ + AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win32/zdll.lib]) + ]) ], [ AC_SUBST(ZLIB_OBJS,[\${ZLIB_OBJS}]) AC_DEFINE_UNQUOTED(NO_VIZ, 1) -- cgit v0.12 From 026db9973900d03ebaf3e280f8300e3916fe0aaa Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 13 Aug 2012 14:02:23 +0000 Subject: .... but be less verbose --- win/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/Makefile.in b/win/Makefile.in index fbc9274..392bd7a 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -457,7 +457,7 @@ ${TEST_DLL_FILE}: ${TCLTEST_OBJS} ${TCL_STUB_LIB_FILE} # use pre-built zlib1.dll ${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE} - if test "@ZLIB_LIBS@set" == "${ZLIB_DIR}/win64/zdll.libset" ; then \ + @if test "@ZLIB_LIBS@set" == "${ZLIB_DIR}/win64/zdll.libset" ; then \ $(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ else \ $(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ -- cgit v0.12 From 263ace8ece084001464b1b3f8cdf0bfff4ec8538 Mon Sep 17 00:00:00 2001 From: stwo Date: Mon, 13 Aug 2012 14:18:55 +0000 Subject: [Bug 3555454] Rearrange a bit to quash 'declared but never defined' compiler warnings. --- ChangeLog | 5 +++++ unix/tclUnixCompat.c | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1eb9b8..cc70f44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-13 Stuart Cassoff + + * unix/tclUnixCompat.c: [Bug 3555454] Rearrange a bit + to quash 'declared but never defined' compiler warnings. + 2012-08-13 Jan Nijtmans * compat/zlib/win64/zlib1.dll: Add 64-bit build of zlib1.dll, and use it diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 359e253..e201018 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -99,12 +99,20 @@ static Tcl_Mutex compatLock; #undef NEED_COPYPWD #undef NEED_COPYSTRING +#if !defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4) +#define NEED_COPYGRP 1 +static int CopyGrp(struct group *tgtPtr, char *buf, int buflen); +#endif + +#if !defined(HAVE_GETPWNAM_R_5) && !defined(HAVE_GETPWNAM_R_4) +#define NEED_COPYPWD 1 +static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen); +#endif + static int CopyArray(char **src, int elsize, char *buf, int buflen); -static int CopyGrp(struct group *tgtPtr, char *buf, int buflen); static int CopyHostent(struct hostent *tgtPtr, char *buf, int buflen); -static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen); static int CopyString(const char *src, char *buf, int buflen); #endif @@ -214,7 +222,6 @@ TclpGetPwNam( return getpwnam_r(name, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)); #else -#define NEED_COPYPWD 1 struct passwd *pwPtr; Tcl_MutexLock(&compatLock); @@ -295,7 +302,6 @@ TclpGetPwUid( return getpwuid_r(uid, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)); #else -#define NEED_COPYPWD 1 struct passwd *pwPtr; Tcl_MutexLock(&compatLock); @@ -399,7 +405,6 @@ TclpGetGrNam( return getgrnam_r(name, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)); #else -#define NEED_COPYGRP 1 struct group *grPtr; Tcl_MutexLock(&compatLock); @@ -480,7 +485,6 @@ TclpGetGrGid( return getgrgid_r(gid, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)); #else -#define NEED_COPYGRP 1 struct group *grPtr; Tcl_MutexLock(&compatLock); -- cgit v0.12 From 15741b0a0f7182f52283a7c3cac4513b14af1359 Mon Sep 17 00:00:00 2001 From: stwo Date: Mon, 13 Aug 2012 22:27:14 +0000 Subject: [Bug 3555454] Rearrange a bit to quash 'declared but never defined' compiler warnings. --- ChangeLog | 5 +++++ unix/tclUnixCompat.c | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6499d7..5374478 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-13 Stuart Cassoff + + * unix/tclUnixCompat.c: [Bug 3555454] Rearrange a bit + to quash 'declared but never defined' compiler warnings. + 2012-08-08 Jan Nijtmans * generic/tclfileName.c: [Bug #1536227]: Cygwin network pathname diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 8b067af..06c19b9 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -99,12 +99,20 @@ static Tcl_Mutex compatLock; #undef NEED_COPYPWD #undef NEED_COPYSTRING +#if !defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4) +#define NEED_COPYGRP 1 +static int CopyGrp(struct group *tgtPtr, char *buf, int buflen); +#endif + +#if !defined(HAVE_GETPWNAM_R_5) && !defined(HAVE_GETPWNAM_R_4) +#define NEED_COPYPWD 1 +static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen); +#endif + static int CopyArray(char **src, int elsize, char *buf, int buflen); -static int CopyGrp(struct group *tgtPtr, char *buf, int buflen); static int CopyHostent(struct hostent *tgtPtr, char *buf, int buflen); -static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen); static int CopyString(const char *src, char *buf, int buflen); #endif @@ -214,7 +222,6 @@ TclpGetPwNam( return getpwnam_r(name, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)); #else -#define NEED_COPYPWD 1 struct passwd *pwPtr; Tcl_MutexLock(&compatLock); @@ -295,7 +302,6 @@ TclpGetPwUid( return getpwuid_r(uid, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)); #else -#define NEED_COPYPWD 1 struct passwd *pwPtr; Tcl_MutexLock(&compatLock); @@ -399,7 +405,6 @@ TclpGetGrNam( return getgrnam_r(name, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)); #else -#define NEED_COPYGRP 1 struct group *grPtr; Tcl_MutexLock(&compatLock); @@ -480,7 +485,6 @@ TclpGetGrGid( return getgrgid_r(gid, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)); #else -#define NEED_COPYGRP 1 struct group *grPtr; Tcl_MutexLock(&compatLock); -- cgit v0.12 From 9dbf0547c43ef5ce4b301582d9e950dbe2b70a97 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 15 Aug 2012 08:12:39 +0000 Subject: Only build the threaded builds by default. Backport some improvements from Tcl 8.6 --- ChangeLog | 6 +++ win/buildall.vc.bat | 68 +++++++++-------------- win/makefile.vc | 153 +++++++++++++++++++++++++++++++++++----------------- win/rules.vc | 63 ++++++++++++++-------- 4 files changed, 175 insertions(+), 115 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5374478..9956dd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-15 Jan Nijtmans + + * win/buildall.vc.bat: Only build the threaded builds by default + * win/rules.vc: Backport some improvements from Tcl 8.6 + * win/makefile.vc: + 2010-08-13 Stuart Cassoff * unix/tclUnixCompat.c: [Bug 3555454] Rearrange a bit diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index 55b29ae..0c9b3ac 100644 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -1,4 +1,5 @@ @echo off + :: This is an example batchfile for building everything. Please :: edit this (or make your own) for your needs and wants using :: the instructions for calling makefile.vc found in makefile.vc @@ -22,17 +23,25 @@ goto OPTIONS_DONE :: reset errorlevel cd > nul +:: You might have installed your developer studio to add itself to the +:: path or have already run vcvars32.bat. Testing these envars proves +:: cl.exe and friends are in your path. +:: +if defined VCINSTALLDIR (goto :startBuilding) +if defined MSDEVDIR (goto :startBuilding) +if defined MSVCDIR (goto :startBuilding) +if defined MSSDK (goto :startBuilding) +if defined WINDOWSSDKDIR (goto :startBuilding) + :: We need to run the development environment batch script that comes -:: with developer studio (v4,5,6,7,etc...) All have it. These paths -:: might not be correct. You may need to edit these. +:: with developer studio (v4,5,6,7,etc...) All have it. This path +:: might not be correct. You should call it yourself prior to running +:: this batchfile. :: -if not defined MSDevDir ( - call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" - ::call "C:\Program Files\Microsoft Developer Studio\vc\bin\vcvars32.bat" - ::call c:\dev\devstudio60\vc98\bin\vcvars32.bat - if errorlevel 1 goto no_vcvars -) +call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" +if errorlevel 1 (goto no_vcvars) +:startBuilding echo. echo Sit back and have a cup of coffee while this grinds through ;) @@ -50,45 +59,16 @@ if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl :: Build the normal stuff along with the help file. :: -set OPTS=none -if not %SYMBOLS%.==. set OPTS=symbols -nmake -nologo -f makefile.vc release winhelp OPTS=%OPTS% %1 -if errorlevel 1 goto error - -:: Build the static core, dlls and shell. -:: -set OPTS=static -if not %SYMBOLS%.==. set OPTS=symbols,static -nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 -if errorlevel 1 goto error - -:: Build the special static libraries that use the dynamic runtime. -:: -set OPTS=static,msvcrt -if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt -nmake -nologo -f makefile.vc core dlls OPTS=%OPTS% %1 -if errorlevel 1 goto error - -:: Build the core and shell for thread support. -:: set OPTS=threads if not %SYMBOLS%.==. set OPTS=symbols,threads -nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 -if errorlevel 1 goto error - -:: Build a static, thread support core library with a shell. -:: -set OPTS=static,threads -if not %SYMBOLS%.==. set OPTS=symbols,static,threads -nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 +nmake -nologo -f makefile.vc release winhelp OPTS=%OPTS% %1 if errorlevel 1 goto error -:: Build the special static libraries that use the dynamic runtime, -:: but now with thread support. +:: Build the static core and shell. :: set OPTS=static,msvcrt,threads if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads -nmake -nologo -f makefile.vc core dlls OPTS=%OPTS% %1 +nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 if errorlevel 1 goto error set OPTS= @@ -100,15 +80,15 @@ echo *** BOOM! *** goto end :no_vcvars -echo vcvars32.bat not found. You'll need to edit this batch script. +echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. goto out :help title buildall.vc.bat help message echo usage: -echo %0 : builds Tcl for all build types (do this first) -echo %0 install : installs all the release builds (do this second) -echo %0 symbols : builds Tcl for all debugging build types +echo %0 : builds Tcl for all build types (do this first) +echo %0 install : installs all the release builds (do this second) +echo %0 symbols : builds Tcl for all debugging build types echo %0 symbols install : install all the debug builds. echo. goto out diff --git a/win/makefile.vc b/win/makefile.vc index 5db8143..3d17331 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -5,7 +5,7 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# +# # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001-2005 ActiveState Corporation. @@ -58,67 +58,72 @@ the build instructions. # makefile. Helpful to avoid problems when the sources are # refreshed and you rebuild, but can "overbuild" when common # headers like tclInt.h just get small changes. +# htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the +# troff manual pages found in $(ROOT)\doc. You need to +# have installed the HTML Help Compiler package from Microsoft +# to produce the .chm file. # winhelp -- Builds the windows .hlp file for Tcl from the troff man -# files found in $(ROOT)\doc . +# files found in $(ROOT)\doc. # # 4) Macros usable on the commandline: # INSTALLDIR= # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=static,msvcrt,staticpkg,threads,symbols,profile,loimpact,unchecked,none +# OPTS=loimpact,msvcrt,static,staticpkg,symbols,threads,profile,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # -# static = Builds a static library of the core instead of a -# dll. The shell will be static (and large), as well. -# msvcrt = Affects the static option only to switch it from +# loimpact = Adds a flag for how NT treats the heap to keep memory +# in use, low. This is said to impact alloc performance. +# msvcrt = Affects the static option only to switch it from # using libcmt(d) as the C runtime [by default] to # msvcrt(d). This is useful for static embedding # support. -# staticpkg = Affects the static option only to switch +# static = Builds a static library of the core instead of a +# dll. The shell will be static (and large), as well. +# staticpkg= Affects the static option only to switch # tclshXX.exe to have the dde and reg extension linked # inside it. -# threads = Turns on full multithreading support. +# threads = Turns on full multithreading support. # thrdalloc = Use the thread allocator (shared global free pool). # thrdstorage = Use the generic thread storage support. # symbols = Adds symbols for step debugging. # profile = Adds profiling hooks. Map file is assumed. -# loimpact = Adds a flag for how NT treats the heap to keep memory -# in use, low. This is said to impact alloc performance. # unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). # -# STATS=memdbg,compdbg,none +# STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added # to the core. The default is for none. Any combination of the # above may be used (comma separated). 'none' will over-ride # everything to nothing. # -# memdbg = Enables the debugging memory allocator. # compdbg = Enables byte compilation logging. +# memdbg = Enables the debugging memory allocator. # -# CHECKS=nodep,fullwarn,64bit,none +# CHECKS=64bit,fullwarn,nodep,none # Sets special macros for checking compatability. # -# nodep = Turns off compatability macros to ensure the core -# isn't being built with deprecated functions. +# 64bit = Enable 64bit portability warnings (if available) # fullwarn = Builds with full compiler and link warnings enabled. # Very verbose. -# 64bit = Enable 64bit portability warnings (if available) +# nodep = Turns off compatability macros to ensure the core +# isn't being built with deprecated functions. # -# MACHINE=(IX86|IA64|AMD64|ALPHA) +# MACHINE=(ALPHA|AMD64|IA64|IX86) # Set the machine type used for the compiler, linker, and # resource compiler. This hook is needed to tell the tools # when alternate platforms are requested. IX86 is the default -# when not specified. +# when not specified. If the CPU environment variable has been +# set (ie: recent Platform SDK) then MACHINE is set from CPU. # # TMP_DIR= # OUT_DIR= # Hooks to allow the intermediate and output directories to be -# changed. $(OUT_DIR) is assumed to be +# changed. $(OUT_DIR) is assumed to be # $(BINROOT)\(Release|Debug) based on if symbols are requested. # $(TMP_DIR) will de $(OUT_DIR)\ by default. # @@ -170,7 +175,7 @@ Please `cd` to its location first. !error $(MSG) !endif -PROJECT = tcl +PROJECT = tcl !include "rules.vc" STUBPREFIX = $(PROJECT)stub @@ -397,7 +402,8 @@ TCLOBJS = \ $(TMP_DIR)\tcl.res !endif -TCLSTUBOBJS = $(TMP_DIR)\tclStubLib.obj +TCLSTUBOBJS = \ + $(TMP_DIR)\tclStubLib.obj ### The following paths CANNOT have spaces in them. COMPATDIR = $(ROOT)\compat @@ -407,7 +413,6 @@ TOMMATHDIR = $(ROOT)\libtommath TOOLSDIR = $(ROOT)\tools WINDIR = $(ROOT)\win - #--------------------------------------------------------------------- # Compile flags #--------------------------------------------------------------------- @@ -452,8 +457,7 @@ TCL_DEFINES = -DTCL_PIPE_DLL=\"$(TCLPIPEDLLNAME)\" -DTCL_TOMMATH -DMP_PREC=4 -Di BASE_CFLAGS = $(cflags) $(cdebug) $(crt) $(TCL_INCLUDES) $(TCL_DEFINES) CON_CFLAGS = $(cflags) $(cdebug) $(crt) -DCONSOLE TCL_CFLAGS = $(BASE_CFLAGS) $(OPTDEFINES) -### Stubs files should not be compiled with -GL -STUB_CFLAGS = $(cflags) $(cdebug:-GL=) $(OPTDEFINES) +STUB_CFLAGS = $(cflags) $(cdebug) $(OPTDEFINES) #--------------------------------------------------------------------- @@ -522,17 +526,17 @@ all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) tcltest: setup $(TCLTEST) dlls $(CAT32) install: install-binaries install-libraries install-docs - -test: setup $(TCLTEST) dlls $(CAT32) - set TCL_LIBRARY=$(ROOT)/library +test: test-core +test-core: setup $(TCLTEST) dlls $(CAT32) + set TCL_LIBRARY=$(ROOT:\=/)/library !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(TCLTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) -loadfile << + $(DEBUGGER) $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile << package ifneeded dde 1.3.3 [list load "$(TCLDDELIB:\=/)" dde] package ifneeded registry 1.2.2 [list load "$(TCLREGLIB:\=/)" registry] << !else @echo Please wait while the tests are collected... - $(TCLTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) -loadfile << > tests.log + $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile << > tests.log package ifneeded dde 1.3.3 "$(TCLDDELIB:\=/)" dde] package ifneeded registry 1.2.2 "$(TCLREGLIB:\=/)" registry] << @@ -540,8 +544,12 @@ test: setup $(TCLTEST) dlls $(CAT32) !endif runtest: setup $(TCLTEST) dlls $(CAT32) - set TCL_LIBRARY=$(ROOT)/library - $(DEBUGGER) $(TCLTEST) + set TCL_LIBRARY=$(ROOT:\=/)/library + $(DEBUGGER) $(TCLTEST) $(SCRIPT) + +runshell: setup $(TCLSH) dlls + set TCL_LIBRARY=$(ROOT:\=/)/library + $(DEBUGGER) $(TCLSH) $(SCRIPT) setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @@ -553,7 +561,7 @@ $(TCLIMPLIB): $(TCLLIB) $(TCLLIB): $(TCLOBJS) !if $(STATIC_BUILD) - $(lib32) -nologo -out:$@ @<< + $(lib32) -nologo $(LINKERFLAGS) -out:$@ @<< $** << !else @@ -566,13 +574,13 @@ $** !endif $(TCLSTUBLIB): $(TCLSTUBOBJS) - $(lib32) -nologo -out:$@ $(TCLSTUBOBJS) + $(lib32) -nologo $(LINKERFLAGS) -out:$@ $(TCLSTUBOBJS) -$(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB) +$(TCLSH): $(TCLSHOBJS) $(TCLSTUBLIB) $(TCLIMPLIB) $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $** $(_VC_MANIFEST_EMBED_EXE) -$(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB) +$(TCLTEST): $(TCLTESTOBJS) $(TCLSTUBLIB) $(TCLIMPLIB) $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $** $(_VC_MANIFEST_EMBED_EXE) @@ -583,7 +591,7 @@ $(TCLPIPEDLL): $(WINDIR)\stub16.c !if $(STATIC_BUILD) $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj - $(lib32) -nologo -out:$@ $** + $(lib32) -nologo $(LINKERFLAGS) -out:$@ $** !else $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB) $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ \ @@ -595,7 +603,7 @@ $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB) !if $(STATIC_BUILD) $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj - $(lib32) -nologo -out:$@ $** + $(lib32) -nologo $(LINKERFLAGS) -out:$@ $** !else $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB) $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ \ @@ -641,9 +649,49 @@ gentommath_h: !endif #--------------------------------------------------------------------- -# Build the windows help file. +# Build the Windows HTML help file. #--------------------------------------------------------------------- +# NOTE: you can define HHC on the command-line to override this +!ifndef HHC +HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe"" +!endif +HTMLDIR=$(ROOT)\html +HTMLBASE=TclTk$(VERSION) +HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp +CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm + +htmlhelp: chmsetup $(CHMFILE) + +$(CHMFILE): $(DOCDIR)\* + @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl + @echo Compiling HTML help project + @$(HHC) <<$(HHPFILE) >NUL +[OPTIONS] +Compatibility=1.1 or later +Compiled file=$(HTMLBASE).chm +Display compile progress=no +Error log file=$(HTMLBASE).log +Language=0x409 English (United States) +Title=Tcl/Tk $(DOT_VERSION) Help +[FILES] +contents.htm +docs.css +Keywords +TclCmd +TclLib +TkCmd +TkLib +UserCmd +<< + +chmsetup: + @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR) + +#------------------------------------------------------------------------- +# Build the old-style Windows .hlp file +#------------------------------------------------------------------------- + TCLHLPBASE = $(PROJECT)$(VERSION) HELPFILE = $(OUT_DIR)\$(TCLHLPBASE).hlp HELPCNT = $(OUT_DIR)\$(TCLHLPBASE).cnt @@ -701,7 +749,12 @@ $(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) $(DOCDIR)\* $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/) install-docs: -!if exist($(HELPFILE)) +!if exist("$(CHMFILE)") + @echo Installing compiled HTML help + @$(CPY) "$(CHMFILE)" "$(DOC_INSTALL_DIR)\" +!endif +!if exist("$(HELPFILE)") + @echo Installing Windows help @$(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" @$(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" !endif @@ -732,8 +785,8 @@ $(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in @LIBS@ $(baselibs) @prefix@ $(_INSTALLDIR) @exec_prefix@ $(BIN_INSTALL_DIR) -@SHLIB_CFLAGS@ -@STLIB_CFLAGS@ +@SHLIB_CFLAGS@ +@STLIB_CFLAGS@ @CFLAGS_WARNING@ -W3 @EXTRA_CFLAGS@ -YX @SHLIB_LD@ $(link32) $(dlllflags) @@ -751,7 +804,7 @@ $(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in @TCL_INCLUDE_SPEC@ -I$(INCLUDE_INSTALL_DIR) @TCL_LIB_VERSIONS_OK@ @TCL_SRC_DIR@ $(ROOT) -@TCL_PACKAGE_PATH@ +@TCL_PACKAGE_PATH@ @TCL_STUB_LIB_FILE@ $(TCLSTUBLIBNAME) @TCL_STUB_LIB_FLAG@ $(TCLSTUBLIBNAME) @TCL_STUB_LIB_SPEC@ -L$(LIB_INSTALL_DIR) $(TCLSTUBLIBNAME) @@ -771,7 +824,7 @@ $(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in #--------------------------------------------------------------------- -# The following target generates the file generic/tclDate.c +# The following target generates the file generic/tclDate.c # from the yacc grammar found in generic/tclGetDate.y. This is # only run by hand as yacc is not available in all environments. # The name of the .c file is different than the name of the .y file @@ -1023,15 +1076,15 @@ install-libraries: tclConfig install-msgs install-tzdata install-tzdata: @echo Installing time zone data - @set TCL_LIBRARY=$(ROOT)/library - @$(TCLSH_NATIVE) "$(ROOT)/tools/installData.tcl" \ - "$(ROOT)/library/tzdata" "$(SCRIPT_INSTALL_DIR)/tzdata" + @set TCL_LIBRARY=$(ROOT:\=/)/library + @$(TCLSH_NATIVE) "$(ROOT:\=/)/tools/installData.tcl" \ + "$(ROOT:\=/)/library/tzdata" "$(SCRIPT_INSTALL_DIR)/tzdata" install-msgs: @echo Installing message catalogs - @set TCL_LIBRARY=$(ROOT)/library - @$(TCLSH_NATIVE) "$(ROOT)/tools/installData.tcl" \ - "$(ROOT)/library/msgs" "$(SCRIPT_INSTALL_DIR)/msgs" + @set TCL_LIBRARY=$(ROOT:\=/)/library + @$(TCLSH_NATIVE) "$(ROOT:\=/)/tools/installData.tcl" \ + "$(ROOT:\=/)/library/msgs" "$(SCRIPT_INSTALL_DIR)/msgs" #--------------------------------------------------------------------- # Clean up @@ -1069,6 +1122,8 @@ clean: @echo Cleaning $(WINDIR)\versions.vc ... @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc +realclean: hose + hose: @echo Hosing $(OUT_DIR)\* ... @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) diff --git a/win/rules.vc b/win/rules.vc index 20c967a..bbf7485 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -6,9 +6,9 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# +# # Copyright (c) 2001-2003 David Gravereaux. -# Copyright (c) 2003-2007 Patrick Thoyts +# Copyright (c) 2003-2008 Patrick Thoyts #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -217,7 +217,8 @@ TCL_THREADS = 0 DEBUG = 0 SYMBOLS = 0 PROFILE = 0 -MSVCRT = 0 +PGO = 0 +MSVCRT = 1 LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 0 @@ -233,9 +234,13 @@ STATIC_BUILD = 0 !message *** Doing msvcrt MSVCRT = 1 !else +!if !$(STATIC_BUILD) +MSVCRT = 1 +!else MSVCRT = 0 !endif -!if [nmakehlp -f $(OPTS) "staticpkg"] +!endif +!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 !else @@ -244,8 +249,10 @@ TCL_USE_STATIC_PACKAGES = 0 !if [nmakehlp -f $(OPTS) "threads"] !message *** Doing threads TCL_THREADS = 1 +USE_THREAD_ALLOC = 1 !else TCL_THREADS = 0 +USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "symbols"] !message *** Doing symbols @@ -265,6 +272,15 @@ PROFILE = 1 !else PROFILE = 0 !endif +!if [nmakehlp -f $(OPTS) "pgi"] +!message *** Doing profile guided optimization instrumentation +PGO = 1 +!elseif [nmakehlp -f $(OPTS) "pgo"] +!message *** Doing profile guided optimization +PGO = 2 +!else +PGO = 0 +!endif !if [nmakehlp -f $(OPTS) "loimpact"] !message *** Doing loimpact LOIMPACT = 1 @@ -274,7 +290,9 @@ LOIMPACT = 0 !if [nmakehlp -f $(OPTS) "thrdalloc"] !message *** Doing thrdalloc USE_THREAD_ALLOC = 1 -!else +!endif +!if [nmakehlp -f $(OPTS) "tclalloc"] +!message *** Doing tclalloc USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "unchecked"] @@ -285,15 +303,6 @@ UNCHECKED = 0 !endif !endif - -!if !$(STATIC_BUILD) -# Make sure we don't build overly fat DLLs. -MSVCRT = 1 -# We shouldn't statically put the extensions inside the shell when dynamic. -TCL_USE_STATIC_PACKAGES = 0 -!endif - - #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. # We wouldn't want different builds to use the same .obj files @@ -335,10 +344,8 @@ TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX TMP_DIRFULL = $(TMP_DIRFULL:Static=) SUFX = $(SUFX:s=) EXT = dll -!if $(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) -!endif !else TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) EXT = lib @@ -417,6 +424,24 @@ WARNINGS = $(WARNINGS) -Wp64 !endif !endif +!if $(PGO) > 1 +!if [nmakehlp -l -ltcg:pgoptimize] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!elseif $(PGO) > 0 +!if [nmakehlp -l -ltcg:pginstrument] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!endif + #---------------------------------------------------------- # Set our defines now armed with our options. #---------------------------------------------------------- @@ -552,12 +577,6 @@ Failed to find tcl.h. The TCLDIR macro does not appear correct. TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) -!if $(TCL_VERSION) < 81 -TCL_DOES_STUBS = 0 -!else -TCL_DOES_STUBS = 1 -!endif - !if $(TCLINSTALL) TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" !if !exist($(TCLSH)) && $(TCL_THREADS) -- cgit v0.12 From 50d80bc71893acbc27ec158d7fc0607e1c8e50b6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 15 Aug 2012 08:41:03 +0000 Subject: build htmlhelp, not winhelp by default --- win/buildall.vc.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index fed5e64..e4f0a30 100755 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -61,7 +61,7 @@ if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl :: set OPTS=none if not %SYMBOLS%.==. set OPTS=symbols -nmake -nologo -f makefile.vc release winhelp OPTS=%OPTS% %1 +nmake -nologo -f makefile.vc release htmlhelp OPTS=%OPTS% %1 if errorlevel 1 goto error :: Build the static core and shell. -- cgit v0.12 From 7c1018370361dd17edaa31c3baac76a615d73059 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Aug 2012 07:15:31 +0000 Subject: nmakehlp: Add "-V" option, in order to be able to detect partial version numbers. --- win/nmakehlp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 2868857..d0edcf0 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -47,7 +47,7 @@ static int CheckForLinkerFeature(const char *option); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); -static const char *GetVersionFromFile(const char *filename, const char *match); +static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); static DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ @@ -153,7 +153,7 @@ main( &dwWritten, NULL); return 0; } - printf("%s\n", GetVersionFromFile(argv[2], argv[3])); + printf("%s\n", GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0')); return 0; case 'Q': if (argc != 3) { @@ -479,7 +479,8 @@ IsIn( static const char * GetVersionFromFile( const char *filename, - const char *match) + const char *match, + int numdots) { size_t cbBuffer = 100; static char szBuffer[100]; @@ -509,7 +510,8 @@ GetVersionFromFile( */ q = p; - while (*q && (isalnum(*q) || *q == '.')) { + while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q) + && (!strchr("ab", q[-1])) || --numdots))) { ++q; } -- cgit v0.12 From 087231e55e5ff1f00a7c61f88faac65f8155f504 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Aug 2012 07:16:25 +0000 Subject: nmakehlp: Add "-V" option, in order to be able to detect partial version numbers. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 77d483d..b8b9f2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-17 Jan Nijtmans + + * win/nmakehlp.c: Add "-V" option, in order to be able + to detect partial version numbers. + 2012-07-31 Jan Nijtmans * win/nmakehlp.c: Backport from Tcl 8.6, but add -Q option from -- cgit v0.12 From 45f8aafc9099cb3ee0ae65d68f59d57ba5cec4d9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 20 Aug 2012 08:59:36 +0000 Subject: Remove wrapper macro for ntohs(): unnecessary, because it doesn't require an initialized winsock_2 library --- generic/tclStubInit.c | 7 +------ win/tclWinPort.h | 1 - win/tclWinSock.c | 22 ++-------------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 7b73ee3..3be6b45 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -74,6 +74,7 @@ MODULE_SCOPE TclIntPlatStubs tclIntPlatStubs; MODULE_SCOPE TclPlatStubs tclPlatStubs; MODULE_SCOPE TclStubs tclStubs; MODULE_SCOPE TclTomMathStubs tclTomMathStubs; +#define TclWinNToHS ntohs #ifdef __WIN32__ # define TclUnixWaitForFile 0 @@ -112,12 +113,6 @@ void *TclWinGetTclInstance() return hInstance; } -unsigned short -TclWinNToHS(unsigned short ns) -{ - return ntohs(ns); -} - int TclWinSetSockOpt(SOCKET s, int level, int optname, const char *optval, int optlen) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 4f9e8b8..f58014c 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -457,7 +457,6 @@ typedef DWORD_PTR * PDWORD_PTR; #define getservbyname TclWinGetServByName #define getsockopt TclWinGetSockOpt -#define ntohs TclWinNToHS #define setsockopt TclWinSetSockOpt /* This type is not defined in the Windows headers */ #define socklen_t int diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 63f166d..8f2028d 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -65,7 +65,6 @@ #undef getservbyname #undef getsockopt -#undef ntohs #undef setsockopt /* @@ -131,7 +130,7 @@ typedef struct SocketInfo { * socket event occurs. */ -typedef struct SocketEvent { +typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ SOCKET socket; /* Socket descriptor that is ready. Used to @@ -159,7 +158,7 @@ typedef struct SocketEvent { #define SOCKET_PENDING (1<<3) /* A message has been sent for this * socket */ -typedef struct ThreadSpecificData { +typedef struct { HWND hwnd; /* Handle to window for socket messages. */ HANDLE socketThread; /* Thread handling the window */ Tcl_ThreadId threadId; /* Parent thread. */ @@ -2508,23 +2507,6 @@ TclWinSetSockOpt(SOCKET s, int level, int optname, const char *optval, return setsockopt(s, level, optname, optval, optlen); } -unsigned short -TclWinNToHS(unsigned short netshort) -{ - /* - * Check that WinSock is initialized; do not call it if not, to - * prevent system crashes. This can happen at exit time if the exit - * handler for WinSock ran before other exit handlers that want to - * use sockets. - */ - - if (!SocketsEnabled()) { - return (unsigned short) -1; - } - - return ntohs(netshort); -} - char * TclpInetNtoa(struct in_addr addr) { -- cgit v0.12 From ac385804788ee5d3a9ee7929a7df56b930b6b8d7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 20 Aug 2012 09:01:08 +0000 Subject: ... and don't forget ChangeLog entry --- ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3dfcc09..d5e6345 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-08-20 Jan Nijtmans + + * win/tclWinPort.h: Remove wrapper macro for ntohs(): unnecessary, + because it doesn't require an initialized winsock_2 library. See: + + * win/tclWinSock.c + * generic/tclStubInit.c + 2012-08-17 Jan Nijtmans * win/nmakehlp.c: Add "-V" option, in order to be able -- cgit v0.12 From 843b8497d3c972540e5b12b26ae3055d9df4bf77 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 20 Aug 2012 23:45:25 +0000 Subject: 3559678 Fix bad filename normalization when the last component is the empty string. --- ChangeLog | 5 +++++ generic/tclPathObj.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5e6345..b1c9079 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Don Porter + + * generic/tclPathObj.c: [Bug 3559678] Fix bad filename normalization + when the last component is the empty string. + 2012-08-20 Jan Nijtmans * win/tclWinPort.h: Remove wrapper macro for ntohs(): unnecessary, diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index ac9df3a..c9b3b8e 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -1831,7 +1831,7 @@ Tcl_FSGetNormalizedPath( */ Tcl_Obj *dir, *copy; - int cwdLen, pathType; + int tailLen, cwdLen, pathType; pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr); dir = Tcl_FSGetNormalizedPath(interp, fsPathPtr->cwdPtr); @@ -1843,7 +1843,12 @@ Tcl_FSGetNormalizedPath( UpdateStringOfFsPath(pathPtr); } - copy = AppendPath(dir, fsPathPtr->normPathPtr); + Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &tailLen); + if (tailLen) { + copy = AppendPath(dir, fsPathPtr->normPathPtr); + } else { + copy = Tcl_DuplicateObj(dir); + } Tcl_IncrRefCount(dir); Tcl_IncrRefCount(copy); -- cgit v0.12 From 77e356e2cee812b76dd325d0f34ad239eb75f82a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 23 Aug 2012 12:07:22 +0000 Subject: [Bug 3496014] Protect Tcl_SetByteArrayObj for invalid values (Backported from Tcl 8.6) --- ChangeLog | 5 +++++ generic/tclBinary.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b1c9079..74ff19b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-23 Jan Nijtmans + + * generic/tclBinary.c: [Bug 3496014] (Backport from Tcl 8.6) Protect + Tcl_SetByteArrayObj for invalid values. + 2012-08-20 Don Porter * generic/tclPathObj.c: [Bug 3559678] Fix bad filename normalization diff --git a/generic/tclBinary.c b/generic/tclBinary.c index f321b28..8c95305 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -273,10 +273,15 @@ Tcl_SetByteArrayObj( TclFreeIntRep(objPtr); Tcl_InvalidateStringRep(objPtr); + if (length < 0) { + length = 0; + } byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length)); byteArrayPtr->used = length; byteArrayPtr->allocated = length; - memcpy(byteArrayPtr->bytes, bytes, (size_t) length); + if (length && bytes) { + memcpy(byteArrayPtr->bytes, bytes, (size_t) length); + } objPtr->typePtr = &tclByteArrayType; SET_BYTEARRAY(objPtr, byteArrayPtr); -- cgit v0.12 From b02e97a2b368aa22f4d35a51ab1d3efdf197352b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 23 Aug 2012 20:06:18 +0000 Subject: small wrapper for TclWinNToHs, for change in calling convention --- generic/tclStubInit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 3be6b45..6a3207b 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -74,7 +74,12 @@ MODULE_SCOPE TclIntPlatStubs tclIntPlatStubs; MODULE_SCOPE TclPlatStubs tclPlatStubs; MODULE_SCOPE TclStubs tclStubs; MODULE_SCOPE TclTomMathStubs tclTomMathStubs; -#define TclWinNToHS ntohs + +#if defined(_WIN32) || defined(__CYGWIN__) +unsigned short TclWinNToHS(unsigned short ns) { + return ntohs(ns); +} +#endif #ifdef __WIN32__ # define TclUnixWaitForFile 0 -- cgit v0.12 From a204742a21724c1f5404afff35e6450941ee13ac Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 24 Aug 2012 06:29:44 +0000 Subject: make sure that extensions which might still use TclWinNToHS, now use ntohs directly. --- generic/tclIntPlatDecls.h | 5 ++++- generic/tclStubInit.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 34a23a4..1e68c9c 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -845,7 +845,10 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; #undef TclpLocaltime_unix #undef TclpGmtime_unix -#if !defined(__WIN32__) && !defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) +# undef TclWinNToHS +# define TclWinNToHS ntohs +#else # undef TclpGetPid # define TclpGetPid(pid) ((unsigned long) (pid)) #endif diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 6a3207b..d06e174 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -76,6 +76,7 @@ MODULE_SCOPE TclStubs tclStubs; MODULE_SCOPE TclTomMathStubs tclTomMathStubs; #if defined(_WIN32) || defined(__CYGWIN__) +#undef TclWinNToHS unsigned short TclWinNToHS(unsigned short ns) { return ntohs(ns); } -- cgit v0.12 From 5acd6ce01a27ac62f458af4a93a97939fc8f9dd6 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 25 Aug 2012 10:07:16 +0000 Subject: [Bug 3561330]: Use the correct full name of March in Ukrainian. --- ChangeLog | 5 +++++ library/msgs/uk.msg | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 74ff19b..b8776c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-25 Donal K. Fellows + + * library/msgs/uk.msg: [Bug 3561330]: Use the correct full name of + March in Ukrainian. Thanks to Mikhail Teterin for reporting. + 2012-08-23 Jan Nijtmans * generic/tclBinary.c: [Bug 3496014] (Backport from Tcl 8.6) Protect diff --git a/library/msgs/uk.msg b/library/msgs/uk.msg index 3e24f86..7d4c64a 100755 --- a/library/msgs/uk.msg +++ b/library/msgs/uk.msg @@ -33,7 +33,7 @@ namespace eval ::tcl::clock { ::msgcat::mcset uk MONTHS_FULL [list \ "\u0441\u0456\u0447\u043d\u044f"\ "\u043b\u044e\u0442\u043e\u0433\u043e"\ - "\u0431\u0435\u0440\u0435\u0436\u043d\u044f"\ + "\u0431\u0435\u0440\u0435\u0437\u043d\u044f"\ "\u043a\u0432\u0456\u0442\u043d\u044f"\ "\u0442\u0440\u0430\u0432\u043d\u044f"\ "\u0447\u0435\u0440\u0432\u043d\u044f"\ -- cgit v0.12 From fe97a8d7c3a50b23fe6136f9034f16769304d1df Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 25 Aug 2012 16:39:25 +0000 Subject: minor: tidy up formatting --- ChangeLog | 137 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 71 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8776c9..18cdf37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,12 +5,12 @@ 2012-08-23 Jan Nijtmans - * generic/tclBinary.c: [Bug 3496014] (Backport from Tcl 8.6) Protect + * generic/tclBinary.c: [Bug 3496014]: (Backport from Tcl 8.6) Protect Tcl_SetByteArrayObj for invalid values. 2012-08-20 Don Porter - * generic/tclPathObj.c: [Bug 3559678] Fix bad filename normalization + * generic/tclPathObj.c: [Bug 3559678]: Fix bad filename normalization when the last component is the empty string. 2012-08-20 Jan Nijtmans @@ -34,8 +34,8 @@ 2010-08-13 Stuart Cassoff - * unix/tclUnixCompat.c: [Bug 3555454] Rearrange a bit - to quash 'declared but never defined' compiler warnings. + * unix/tclUnixCompat.c: [Bug 3555454]: Rearrange a bit to quash + 'declared but never defined' compiler warnings. 2012-08-08 Jan Nijtmans @@ -44,8 +44,8 @@ 2012-08-07 Don Porter - * generic/tclIOUtil.c: [Bug 3554250] Overlooked one field of - cleanup in the thread exit handler for the filesystem subsystem. + * generic/tclIOUtil.c: [Bug 3554250]: Overlooked one field of cleanup + in the thread exit handler for the filesystem subsystem. 2012-07-31 Jan Nijtmans @@ -54,8 +54,8 @@ 2012-07-28 Jan Nijtmans - * tests/clock.test: [Bug 3549770] Multiple test failures running tcltest - * tests/registry.test: outside build tree + * tests/clock.test: [Bug 3549770]: Multiple test failures running + * tests/registry.test: tcltest outside build tree * tests/winDde.test: 2012-07-27 Jan Nijtmans @@ -112,7 +112,8 @@ 2012-07-10 Jan Nijtmans - * unix/tclUnixNotfy.c: [Bug 3541646] Don't panic on triggerPipe overrun + * unix/tclUnixNotfy.c: [Bug 3541646]: Don't panic on triggerPipe + overrun. 2012-07-10 Donal K. Fellows @@ -123,7 +124,7 @@ 2012-07-05 Don Porter - * unix/tclUnixPipe.c: [Bug 1189293] Make "<<" binary safe. + * unix/tclUnixPipe.c: [Bug 1189293]: Make "<<" binary safe. * win/tclWinPipe.c: 2012-06-29 Jan Nijtmans @@ -132,10 +133,10 @@ 2012-06-29 Harald Oehlmann - * library/msgcat/msgcat.tcl: [Bug 3536888] Locale guessing of msgcat - * library/msgcat/pkgIndex.tcl: fails on (some) Windows 7. Bump to 1.4.5 - * unix/Makefile.in - * win/Makefile.in + * library/msgcat/msgcat.tcl: [Bug 3536888]: Locale guessing of + * library/msgcat/pkgIndex.tcl: msgcat fails on (some) Windows 7. Bump + * unix/Makefile.in: to 1.4.5 + * win/Makefile.in: 2012-06-29 Donal K. Fellows @@ -147,7 +148,7 @@ 2012-06-25 Don Porter - * generic/tclFileSystem.h: [Bug 3024359] Make sure that the + * generic/tclFileSystem.h: [Bug 3024359]: Make sure that the * generic/tclIOUtil.c: per-thread cache of the list of file systems * generic/tclPathObj.c: currently registered is only updated at times when no active loops are traversing it. Also reduce the amount of @@ -176,10 +177,10 @@ 2012-06-11 Don Porter - * generic/tclBasic.c: [Bug 3532959] Make sure the lifetime management - * generic/tclProc.c: of entries in the linePBodyPtr hash table can - * tests/proc.test: tolerate either order of teardown, interp first, - or Proc first. + * generic/tclBasic.c: [Bug 3532959]: Make sure the lifetime + * generic/tclProc.c: management of entries in the linePBodyPtr + * tests/proc.test: hash table can tolerate either order of + teardown, interp first, or Proc first. 2012-06-08 Don Porter @@ -187,7 +188,7 @@ * unix/tclUnixPort.h: Thanks Joe English. * unix/configure: autoconf 2.13 - * unix/tclUnixPort.h: [Bug 3530533] Centralize #include + * unix/tclUnixPort.h: [Bug 3530533]: Centralize #include * unix/tclUnixThrd.c: in the tclUnixPort.h header so that old unix systems that need inclusion in all compilation units are supported. @@ -214,7 +215,7 @@ 2012-05-25 Jan Nijtmans - * win/tclWinDde.c: [Bug 473946] special characters not correctly + * win/tclWinDde.c: [Bug 473946]: special characters not correctly * win/Makefile.in: sent, now for XTYP_EXECUTE as well as XTYP_REQUEST. Fix "make genstubs" when cross-compiling on UNIX @@ -271,7 +272,7 @@ 2012-05-10 Jan Nijtmans - * win/tclWinDde.c: [Bug 473946] special characters not + * win/tclWinDde.c: [Bug 473946]: Special characters not * library/dde/pkgIndex.tcl: correctly sent. Bump to 1.3.3 2012-05-02 Jan Nijtmans @@ -305,10 +306,10 @@ 2012-04-24 Jan Nijtmans - * generic/tclInt.decls: [Bug 3508771] load tclreg.dll in cygwin - * generic/tclIntPlatDecls.h: tclsh Implement TclWinGetSockOpt, - * generic/tclStubInit.c: TclWinGetServByName and TclWinCPUID - * generic/tclUnixCompat.c: for Cygwin. + * generic/tclInt.decls: [Bug 3508771]: load tclreg.dll in + * generic/tclIntPlatDecls.h: cygwin tclsh. Implement + * generic/tclStubInit.c: TclWinGetSockOpt, TclWinGetServByName + * generic/tclUnixCompat.c: and TclWinCPUID for Cygwin. * unix/configure.in: * unix/configure: * unix/tclUnixCompat.c: @@ -330,7 +331,7 @@ 2012-04-11 Jan Nijtmans - * win/tclWinInit.c: [Bug 3448512] [clock scan 1958-01-01] fails + * win/tclWinInit.c: [Bug 3448512]: [clock scan 1958-01-01] fails * win/tcl.m4: in debug compilation. * win/configure: * unix/tcl.m4: Use NDEBUG consistantly meaning: no debugging. @@ -338,7 +339,7 @@ 2012-04-04 Jan Nijtmans - * win/tclWinSock.c: [Bug 510001] TclSockMinimumBuffers needs + * win/tclWinSock.c: [Bug 510001]: TclSockMinimumBuffers needs * generic/tclIOSock.c: platform implementation. * generic/tclInt.decls: * generic/tclIntDecls.h: @@ -353,15 +354,16 @@ 2012-03-30 Jan Nijtmans - * generic/tclInt.decls: [Bug 3508771] load tclreg.dll in cygwin - * generic/tclIntPlatDecls.h: tclsh. Implement TclWinGetTclInstance, - * generic/tclStubInit.c: TclpGetTZName, and various more - win32-specific internal functions for Cygwin, so win32 extensions - using those can be loaded in the cygwin version of tclsh. + * generic/tclInt.decls: [Bug 3508771]: load tclreg.dll in + * generic/tclIntPlatDecls.h: cygwin tclsh. Implement + * generic/tclStubInit.c: TclWinGetTclInstance, TclpGetTZName, + and various more win32-specific internal functions for Cygwin, so + win32 extensions using those can be loaded in the cygwin version of + tclsh. 2012-03-30 Jan Nijtmans - * unix/tcl.m4: [Bug 3511806] Compiler checks too early + * unix/tcl.m4: [Bug 3511806]: Compiler checks too early * unix/configure.in: This change allows to build the cygwin * unix/tclUnixPort.h: and mingw32 ports of Tcl/Tk to build * win/tcl.m4: out-of-the-box using a native or cross- @@ -370,19 +372,20 @@ 2012-03-27 Jan Nijtmans - * generic/tcl.h: [Bug 3508771] Wrong Tcl_StatBuf used on MinGW - * generic/tclFCmd.c: [Bug 2015723] duplicate inodes from file stat + * generic/tcl.h: [Bug 3508771]: Wrong Tcl_StatBuf used on MinGW + * generic/tclFCmd.c: [Bug 2015723]: duplicate inodes from file stat on windows (but now for cygwin as well) 2012-03-25 Jan Nijtmans - * generic/tclInt.decls: [Bug 3508771] load tclreg.dll in cygwin - * generic/tclIntPlatDecls.h: tclsh. Implement TclWinConvertError, - * generic/tclStubInit.c: TclWinConvertWSAError, and various more - * unix/Makefile.in: win32-specific internal functions for - * unix/tcl.m4: Cygwin, so win32 extensions using those - * unix/configure: can be loaded in the cygwin version - * win/tclWinError.c: of tclsh. + * generic/tclInt.decls: [Bug 3508771]: load tclreg.dll in + * generic/tclIntPlatDecls.h: cygwin tclsh. Implement + * generic/tclStubInit.c: TclWinConvertError, + * unix/Makefile.in: TclWinConvertWSAError, and various + * unix/tcl.m4: more win32-specific internal functions + * unix/configure: for Cygwin, so win32 extensions using + * win/tclWinError.c: those can be loaded in the cygwin + version of tclsh. 2012-03-23 Jan Nijtmans @@ -398,12 +401,13 @@ 2012-03-20 Jan Nijtmans - * generic/tcl.decls: [Bug 3508771] load tclreg.dll in cygwin - * generic/tclInt.decls: tclsh. Implement TclWinGetPlatformId, - * generic/tclIntPlatDecls.h: Tcl_WinUtfToTChar, Tcl_WinTCharToUtf - * generic/tclPlatDecls.h: (and a dummy TclWinCPUID) for Cygwin, - * generic/tclStubInit.c: so win32 extensions using those can be - * unix/tclUnixCompat.c: loaded in the cygwin version of tclsh. + * generic/tcl.decls: [Bug 3508771]: load tclreg.dll in + * generic/tclInt.decls: cygwin tclsh. Implement + * generic/tclIntPlatDecls.h: TclWinGetPlatformId,Tcl_WinUtfToTChar, + * generic/tclPlatDecls.h: Tcl_WinTCharToUtf (and a dummy + * generic/tclStubInit.c: TclWinCPUID) for Cygwin, so win32 + * unix/tclUnixCompat.c: extensions using those can be loaded + in the cygwin version of tclsh. 2012-03-19 Venkat Iyer @@ -437,7 +441,7 @@ 2012-03-15 Jan Nijtmans - * generic/tcl.h: [Bug 3288345] Wrong Tcl_StatBuf used on Cygwin + * generic/tcl.h: [Bug 3288345]: Wrong Tcl_StatBuf used on Cygwin * unix/tclUnixFile.c * unix/tclUnixPort.h * win/cat.c: Remove cygwin stuff no longer needed @@ -446,7 +450,7 @@ 2012-03-12 Jan Nijtmans - * win/tclWinFile.c: [Bug 3388350] mingw64 compiler warnings + * win/tclWinFile.c: [Bug 3388350]: mingw64 compiler warnings 2012-03-07 Andreas Kupries @@ -468,7 +472,7 @@ 2012-02-29 Jan Nijtmans - * generic/tclIOUtil.c: [Bug 3466099] BOM in Unicode + * generic/tclIOUtil.c: [Bug 3466099]: BOM in Unicode * generic/tclEncoding.c: * tests/source.test @@ -603,7 +607,7 @@ 2011-12-23 Jan Nijtmans - * generic/tclUtf.c: [Bug 3464428] string is graph \u0120 is wrong + * generic/tclUtf.c: [Bug 3464428]: string is graph \u0120 is wrong * generic/tclUniData.c: * generic/regc_locale.c: * tests/utf.test: @@ -617,7 +621,7 @@ 2011-12-07 Jan Nijtmans - * tools/uniParse.tcl: [Bug 3444754] string tolower \u01c5 is wrong + * tools/uniParse.tcl: [Bug 3444754]: string tolower \u01c5 is wrong * generic/tclUniData.c: * tests/utf.test: @@ -636,7 +640,7 @@ 2011-11-22 Jan Nijtmans - * win/tclWinPort.h: [Bug 3354324] Windows: file mtime + * win/tclWinPort.h: [Bug 3354324]: Windows: file mtime * win/tclWinFile.c: sets wrong time (VS2005+ only) * generic/tclTest.c: @@ -680,15 +684,15 @@ 2011-10-11 Jan Nijtmans - * win/tclWinFile.c: [Bug 2935503] Incorrect mode field + * win/tclWinFile.c: [Bug 2935503]: Incorrect mode field returned by file stat command 2011-10-07 Jan Nijtmans - * generic/tclIORChan.c: Fix gcc warning - (discovered with latest mingw, based on gcc 4.6.1) - * tests/env.test: Fix env.test, when running - under wine 1.3 (partly backported from Tcl 8.6) + * generic/tclIORChan.c: Fix gcc warning (discovered with latest + mingw, based on gcc 4.6.1) + * tests/env.test: Fix env.test running under wine 1.3 (partly + backported from Tcl 8.6) 2011-10-03 Venkat Iyer @@ -723,20 +727,20 @@ 2011-09-13 Don Porter - * generic/tclUtil.c: [Bug 3390638] Workaround broken solaris + * generic/tclUtil.c: [Bug 3390638]: Workaround broken solaris studio cc optimizer. Thanks to Wolfgang S. Kechel. - * generic/tclDTrace.d: [Bug 3405652] Portability workaround for + * generic/tclDTrace.d: [Bug 3405652]: Portability workaround for broken system DTrace support. Thanks to Dagobert Michelson. 2011-09-12 Jan Nijtmans - * win/tclWinPort.h: [Bug 3407070] tclPosixStr.c won't build with + * win/tclWinPort.h: [Bug 3407070]: tclPosixStr.c won't build with EOVERFLOW==E2BIG 2011-09-07 Don Porter - * generic/tclCompExpr.c: [Bug 3401704] Allow function names like + * generic/tclCompExpr.c: [Bug 3401704]: Allow function names like * tests/parseExpr.test: influence(), nanobot(), and 99bottles() that have been parsed as missing operator syntax errors before with the form NUMBER + FUNCTION. @@ -755,7 +759,7 @@ 2011-09-01 Don Porter - * generic/tclStrToD.c: [Bug 3402540] Corrections to TclParseNumber() + * generic/tclStrToD.c: [Bug 3402540]: Corrections to TclParseNumber() * tests/binary.test: to make it reject invalid Nan(Hex) strings. * tests/scan.test: [scan Inf %g] is portable; remove constraint. @@ -933,7 +937,8 @@ 2011-06-13 Don Porter - * generic/tclStrToD.c: [Bug 3315098] Mem leak fix from Gustaf Neumann. + * generic/tclStrToD.c: [Bug 3315098]: Mem leak fix from Gustaf + Neumann. 2011-06-02 Don Porter -- cgit v0.12 From e7975ff335f51d429c79b128209d33f7808f3782 Mon Sep 17 00:00:00 2001 From: andreask Date: Mon, 27 Aug 2012 17:12:06 +0000 Subject: Followup to [6325d5dbeac6f91d28d6]. dlerror() may return NULL. Fixed the code which wasn't prepared to deal with that. --- unix/tclLoadDl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index f8fe6d3..a48aa23 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -176,8 +176,14 @@ FindSymbol( } Tcl_DStringFree(&ds); if (proc == NULL && interp != NULL) { + const char *errorStr = dlerror(); + + if (!errorStr) { + errorStr = "unknown"; + } + Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot find symbol \"%s\": %s", symbol, dlerror())); + "cannot find symbol \"%s\": %s", symbol, errorStr)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); } -- cgit v0.12 From 43f16074cb838b5bb19f3504fc9e6c66458fbdf9 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 27 Aug 2012 17:24:55 +0000 Subject: Commit of Harald Oehlmann's TIP 404 patch without TIP 399 pieces and with some added documentation. No tests for new functionality yet. --- doc/msgcat.n | 28 +++++++++++++++- library/msgcat/msgcat.tcl | 78 +++++++++++++++++++++++++++++++++++++++++++-- library/msgcat/pkgIndex.tcl | 2 +- 3 files changed, 103 insertions(+), 5 deletions(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index 595c85f..d65563a 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -13,7 +13,7 @@ msgcat \- Tcl message catalog .SH SYNOPSIS \fBpackage require Tcl 8.5\fR .sp -\fBpackage require msgcat 1.4.5\fR +\fBpackage require msgcat 1.5.0\fR .sp \fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR? .sp @@ -29,6 +29,12 @@ msgcat \- Tcl message catalog .sp \fB::msgcat::mcmset \fIlocale src-trans-list\fR .sp +.VS "TIP 404" +\fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR? +.sp +\fB::msgcat::mcflmset \fIsrc-trans-list\fR +.VE "TIP 404" +.sp \fB::msgcat::mcunknown \fIlocale src-string\fR .BE .SH DESCRIPTION @@ -131,6 +137,26 @@ translate-string ...\fR?} \fB::msgcat::mcmset\fR can be significantly faster than multiple invocations of \fB::msgcat::mcset\fR. The function returns the number of translations set. .TP +\fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR? +.VS "TIP 404" +Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR in the the +current namespace for the locale implied by the name of the message catalog +being loaded via \fB::msgcat::mcload\fR. If \fItranslate-string\fR is not +specified, \fIsrc-string\fR is used for both. The function returns +\fItranslate-string\fR. +.VE "TIP 404" +.TP +\fB::msgcat::mcflmset \fIsrc-trans-list\fR +.VS "TIP 404" +Sets the translation for multiple source strings in \fIsrc-trans-list\fR in +the current namespace for the locale implied by the name of the message +catalog being loaded via \fB::msgcat::mcload\fR. \fIsrc-trans-list\fR must +have an even number of elements and is in the form {\fIsrc-string +translate-string\fR ?\fIsrc-string translate-string ...\fR?} +\fB::msgcat::mcmset\fR can be significantly faster than multiple invocations +of \fB::msgcat::mcset\fR. The function returns the number of translations set. +.VE "TIP 404" +.TP \fB::msgcat::mcunknown \fIlocale src-string\fR . This routine is called by \fB::msgcat::mc\fR in the case when diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index 3377b47..6dd44d2 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -13,11 +13,11 @@ package require Tcl 8.5 # When the version number changes, be sure to update the pkgIndex.tcl file, # and the installation directory in the Makefiles. -package provide msgcat 1.4.5 +package provide msgcat 1.5.0 namespace eval msgcat { namespace export mc mcload mclocale mcmax mcmset mcpreferences mcset \ - mcunknown + mcunknown mcflset mcflmset # Records the current locale as passed to mclocale variable Locale "" @@ -25,6 +25,12 @@ namespace eval msgcat { # Records the list of locales to search variable Loclist {} + # Records the locale of the currently sourced message catalogue file; this + # would be problematic if anyone were to recursively load a message + # catalog for a different locale from inside a catalog, but that's not a + # case that we really need to worry about. + variable FileLocale + # Records the mapping between source strings and translated strings. The # dict key is of the form " ", where locale and # namespace should be themselves dict values and the value is @@ -277,6 +283,7 @@ proc msgcat::mcpreferences {} { # Returns the number of message catalogs that were loaded. proc msgcat::mcload {langdir} { + variable FileLocale set x 0 foreach p [mcpreferences] { if { $p eq {} } { @@ -285,7 +292,12 @@ proc msgcat::mcload {langdir} { set langfile [file join $langdir $p.msg] if {[file exists $langfile]} { incr x + set FileLocale [string tolower [file tail [file rootname $langfile]]] + if {"root" eq $FileLocale} { + set FileLocale "" + } uplevel 1 [list ::source -encoding utf-8 $langfile] + unset FileLocale } } return $x @@ -318,6 +330,35 @@ proc msgcat::mcset {locale src {dest ""}} { return $dest } +# msgcat::mcflset -- +# +# Set the translation for a given string in the current file locale. +# +# Arguments: +# src The source string. +# dest (Optional) The translated string. If omitted, +# the source string is used. +# +# Results: +# Returns the new locale. + +proc msgcat::mcflset {src {dest ""}} { + variable FileLocale + variable Msgs + + if {![info exists FileLocale]} { + return -code error \ + "must only be used inside a message catalog loaded with ::msgcat::mcload" + } + if {[llength [info level 0]] == 2} { ;# dest not specified + set dest $src + } + + set ns [uplevel 1 [list ::namespace current]] + dict set Msgs $FileLocale $ns $src $dest + return $dest +} + # msgcat::mcmset -- # # Set the translation for multiple strings in a specified locale. @@ -345,7 +386,38 @@ proc msgcat::mcmset {locale pairs } { dict set Msgs $locale $ns $src $dest } - return $length + return [expr {$length / 2}] +} + +# msgcat::mcflmset -- +# +# Set the translation for multiple strings in the mc file locale. +# +# Arguments: +# pairs One or more src/dest pairs (must be even length) +# +# Results: +# Returns the number of pairs processed + +proc msgcat::mcflmset {pairs} { + variable FileLocale + variable Msgs + + if {![info exists FileLocale]} { + return -code error \ + "must only be used inside a message catalog loaded with ::msgcat::mcload" + } + set length [llength $pairs] + if {$length % 2} { + return -code error "bad translation list:\ + should be \"[lindex [info level 0] 0] locale {src dest ...}\"" + } + + set ns [uplevel 1 [list ::namespace current]] + foreach {src dest} $pairs { + dict set Msgs $FileLocale $ns $src $dest + } + return [expr {$length / 2}] } # msgcat::mcunknown -- diff --git a/library/msgcat/pkgIndex.tcl b/library/msgcat/pkgIndex.tcl index 60c2d3c..832bf81 100644 --- a/library/msgcat/pkgIndex.tcl +++ b/library/msgcat/pkgIndex.tcl @@ -1,2 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.5]} {return} -package ifneeded msgcat 1.4.5 [list source [file join $dir msgcat.tcl]] +package ifneeded msgcat 1.5.0 [list source [file join $dir msgcat.tcl]] -- cgit v0.12 From cf8f67a2316359b6e0e563c51d2d6cda34f9cec6 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 30 Aug 2012 18:46:27 +0000 Subject: Update changes for 8.6b3 --- changes | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/changes b/changes index 1430f8c..a69a544 100644 --- a/changes +++ b/changes @@ -8023,8 +8023,6 @@ like "nano()" instead of parsing as "nan o()" with missing op (duquette,porter) 2012-02-02 (bug fix)[2974459,2879351,1951574,1852572,1661378,1613456] Fix problems where [file *able] would return false results on Win/Samba (porter) -2012-02-02 (update)[3464401] Support Unicode 6.1 (nijtmans) - 2012-02-06 (bug fix)[3484621] bump bytecode epoch on exec traces (kuhn,sofer) 2012-02-15 (bug fix)[3487626] crash compiling [dict for] (fellows) @@ -8105,6 +8103,14 @@ and Tcl_FSMountsChanged(). (porter) 2012-07-25 (bug fix)[3546275] [auto_execok] search match [exec] (danckaert) +2012-07-27 (update)[3464401] Support Unicode 6.2 (nijtmans) + +2012-08-20 (bug fix)[3559678] [file normalize] EIAS failure (phao,dgp) + +2012-08-25 (bug fix)[3561330] Ukranian translation of "March" (teterin) + Many revisions to better support a Cygwin environment (nijtmans) +Dropped support for OS X versions less than 10.4 (Tiger) (fellows) + --- Released 8.6b3, July 30, 2012 --- See ChangeLog for details --- -- cgit v0.12 From 4c8d436cd9e92ed6a304fed697f233ecb7996635 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 30 Aug 2012 18:49:11 +0000 Subject: ...and the date too. --- changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes b/changes index a69a544..06b2db1 100644 --- a/changes +++ b/changes @@ -8113,4 +8113,4 @@ Many revisions to better support a Cygwin environment (nijtmans) Dropped support for OS X versions less than 10.4 (Tiger) (fellows) ---- Released 8.6b3, July 30, 2012 --- See ChangeLog for details --- +--- Released 8.6b3, September 7, 2012 --- See ChangeLog for details --- -- cgit v0.12 From 96b1a87503f1da17ec4626ba78ef7a04030e98ce Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 5 Sep 2012 09:37:10 +0000 Subject: Minor clarification of description; all traces use a command prefix for their callbacks. --- doc/trace.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/trace.n b/doc/trace.n index 9d40123..c928856 100644 --- a/doc/trace.n +++ b/doc/trace.n @@ -138,7 +138,7 @@ error will occur. .PP For \fBleave\fR and \fBleavestep\fR operations: .CS -\fIcommand command-string code result op\fR +\fIcommandPrefix command-string code result op\fR .CE \fICommand-string\fR gives the complete current command being executed (the traced command for a \fBenter\fR operation, an -- cgit v0.12 From 41d7976a599beb50796eb6a1316080825fb79047 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 6 Sep 2012 19:01:32 +0000 Subject: 3564735 Protection against namespace var resolvers that unexpectedly return a pointer to Var while Tcl expects pointer to VarInHash. This may not be the total solution to Bug 3564735 (Itcl may be misbehaving), but this will prevent memory corruption. --- generic/tclInt.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index e1ce6d5..cca9938 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -693,13 +693,17 @@ typedef struct VarInHash { #define TclSetVarNamespaceVar(varPtr) \ if (!TclIsVarNamespaceVar(varPtr)) {\ (varPtr)->flags |= VAR_NAMESPACE_VAR;\ - ((VarInHash *)(varPtr))->refCount++;\ + if (TclIsVarInHash(varPtr)) {\ + ((VarInHash *)(varPtr))->refCount++;\ + }\ } #define TclClearVarNamespaceVar(varPtr) \ if (TclIsVarNamespaceVar(varPtr)) {\ (varPtr)->flags &= ~VAR_NAMESPACE_VAR;\ - ((VarInHash *)(varPtr))->refCount--;\ + if (TclIsVarInHash(varPtr)) {\ + ((VarInHash *)(varPtr))->refCount--;\ + }\ } /* -- cgit v0.12 From edd591e8fbb5a6def7fbe9ca0d8e3f22c0e9cd56 Mon Sep 17 00:00:00 2001 From: ferrieux Date: Fri, 7 Sep 2012 14:44:46 +0000 Subject: Backport of 2008-12-12 8.6 commit: Fix missing CLOEXEC on internal pipes [2417695] --- ChangeLog | 5 +++++ unix/tclUnixNotfy.c | 6 ++++++ win/buildall.vc.bat | 0 3 files changed, 11 insertions(+) mode change 100644 => 100755 win/buildall.vc.bat diff --git a/ChangeLog b/ChangeLog index 18cdf37..b0fed83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-07 Alexandre Ferrieux + + * unix/tclUnixNotfy.c Backport of 2008-12-12 8.6 commit: Fix + missing CLOEXEC on internal pipes [2417695] + 2012-08-25 Donal K. Fellows * library/msgs/uk.msg: [Bug 3561330]: Use the correct full name of diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 42cc7be..51f0b1f 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -1057,6 +1057,12 @@ NotifierThreadProc( if (TclUnixSetBlockingMode(fds[1], TCL_MODE_NONBLOCKING) < 0) { Tcl_Panic("NotifierThreadProc: could not make trigger pipe non blocking"); } + if (fcntl(receivePipe, F_SETFD, FD_CLOEXEC) < 0) { + Tcl_Panic("NotifierThreadProc: could not make receive pipe close-on-exec"); + } + if (fcntl(fds[1], F_SETFD, FD_CLOEXEC) < 0) { + Tcl_Panic("NotifierThreadProc: could not make trigger pipe close-on-exec"); + } /* * Install the write end of the pipe into the global variable. diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat old mode 100644 new mode 100755 -- cgit v0.12 From ec48c37cfcfbbd45233696741ce5c7b44b8e43bf Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 7 Sep 2012 15:32:15 +0000 Subject: Reentrant mcfl(m)set command, test, document mcflset as recommended for message files --- doc/msgcat.n | 12 ++++++------ library/msgcat/msgcat.tcl | 12 ++++++++---- tests/msgcat.test | 44 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 12 deletions(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index d65563a..af6be7f 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -139,7 +139,7 @@ returns the number of translations set. .TP \fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR? .VS "TIP 404" -Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR in the the +Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR in the current namespace for the locale implied by the name of the message catalog being loaded via \fB::msgcat::mcload\fR. If \fItranslate-string\fR is not specified, \fIsrc-string\fR is used for both. The function returns @@ -153,8 +153,8 @@ the current namespace for the locale implied by the name of the message catalog being loaded via \fB::msgcat::mcload\fR. \fIsrc-trans-list\fR must have an even number of elements and is in the form {\fIsrc-string translate-string\fR ?\fIsrc-string translate-string ...\fR?} -\fB::msgcat::mcmset\fR can be significantly faster than multiple invocations -of \fB::msgcat::mcset\fR. The function returns the number of translations set. +\fB::msgcat::mcflmset\fR can be significantly faster than multiple invocations +of \fB::msgcat::mcflset\fR. The function returns the number of translations set. .VE "TIP 404" .TP \fB::msgcat::mcunknown \fIlocale src-string\fR @@ -312,15 +312,15 @@ cause peculiar behavior, such as marking the message file as .QW hidden on Unix file systems. .IP [3] -The file contains a series of calls to \fBmcset\fR and -\fBmcmset\fR, setting the necessary translation strings +The file contains a series of calls to \fBmcflset\fR and +\fBmcflmset\fR, setting the necessary translation strings for the language, likely enclosed in a \fBnamespace eval\fR so that all source strings are tied to the namespace of the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcset\fR es "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index 6dd44d2..112507a 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -25,10 +25,7 @@ namespace eval msgcat { # Records the list of locales to search variable Loclist {} - # Records the locale of the currently sourced message catalogue file; this - # would be problematic if anyone were to recursively load a message - # catalog for a different locale from inside a catalog, but that's not a - # case that we really need to worry about. + # Records the locale of the currently sourced message catalogue file variable FileLocale # Records the mapping between source strings and translated strings. The @@ -284,6 +281,10 @@ proc msgcat::mcpreferences {} { proc msgcat::mcload {langdir} { variable FileLocale + # Save the file locale if we are recursively called + if {[info exists FileLocale]} { + set nestedFileLocale $FileLocale + } set x 0 foreach p [mcpreferences] { if { $p eq {} } { @@ -300,6 +301,9 @@ proc msgcat::mcload {langdir} { unset FileLocale } } + if {[info exists nestedFileLocale]} { + set FileLocale $nestedFileLocale + } return $x } diff --git a/tests/msgcat.test b/tests/msgcat.test index bbcd023..d75bf8e 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -17,8 +17,8 @@ if {[catch {package require tcltest 2}]} { puts stderr "Skipping tests in [info script]. tcltest 2 required." return } -if {[catch {package require msgcat 1.4.5}]} { - puts stderr "Skipping tests in [info script]. No msgcat 1.4.5 found to test." +if {[catch {package require msgcat 1.5.0}]} { + puts stderr "Skipping tests in [info script]. No msgcat 1.5.0 found to test." return } @@ -611,6 +611,46 @@ namespace eval ::msgcat::test { mc "this is a %s" "good test" } -result "this is a good test" + # Tests msgcat-8.*: [mcflset] + + set msgdir1 [makeDirectory msgdir1] + makeFile {::msgcat::mcflset k1 v1} l1.msg $msgdir1 + + test msgcat-8.1 {mcflset} -setup { + variable locale [mclocale] + mclocale l1 + mcload $msgdir1 + } -cleanup { + mclocale $locale + } -body { + mc k1 + } -result v1 + + removeFile l1.msg $msgdir1 + removeDirectory msgdir1 + + set msgdir2 [makeDirectory msgdir2] + set msgdir3 [makeDirectory msgdir3] + makeFile "::msgcat::mcflset k2 v2 ; ::msgcat::mcload [list $msgdir3]"\ + l2.msg $msgdir2 + makeFile {::msgcat::mcflset k3 v3} l2.msg $msgdir3 + + # chained mcload + test msgcat-8.2 {mcflset} -setup { + variable locale [mclocale] + mclocale l2 + mcload $msgdir2 + } -cleanup { + mclocale $locale + } -body { + return [mc k2][mc k3] + } -result v2v3 + + removeFile l2.msg $msgdir2 + removeDirectory msgdir2 + removeFile l3.msg $msgdir3 + removeDirectory msgdir3 + cleanupTests } namespace delete ::msgcat::test -- cgit v0.12 From 260678675728634c7eea51913b9227aaf67892df Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 7 Sep 2012 17:22:53 +0000 Subject: ChangeLog entry added --- ChangeLog | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 68f2441..036cd21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-09-07 Harald Oehlmann + + IMPLEMENTATION OF TIP#404. + + * library/msgcat.tcl: [FRQ 3544988]: add commands + [mcflset] and [mcflmset] to set mc entries with implicit message file + locale. Package version is now 1.5.0. + 2012-08-25 Donal K. Fellows * library/msgs/uk.msg: [Bug 3561330]: Use the correct full name of @@ -186,7 +194,7 @@ * library/msgcat/msgcat.tcl: Add tn, ro_MO and ru_MO to msgcat. -2012-06-29 Harald Oehlmann +2012-06-29 Harald Oehlmann * library/msgcat/msgcat.tcl: [Bug 3536888]: Locale guessing of * library/msgcat/pkgIndex.tcl: msgcat fails on (some) Windows 7. Bump -- cgit v0.12 From aafb8f260959dba7316e70f8dfd6afcd1a9248d0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 7 Sep 2012 21:01:14 +0000 Subject: removed leftover from failed attempt to unify stub tables. --- generic/tclStubInit.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 0fc35d5..a8d74ee 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -169,14 +169,6 @@ Tcl_WinTCharToUtf( string, len, dsPtr); } -#define TclMacOSXGetFileAttribute (int (*) (Tcl_Interp *, \ - int, Tcl_Obj *, Tcl_Obj **)) TclpCreateProcess -#define TclMacOSXMatchType (int (*) (Tcl_Interp *, const char *, \ - const char *, Tcl_StatBuf *, Tcl_GlobTypeData *)) TclpMakeFile -#define TclMacOSXNotifierAddRunLoopMode (void (*) (const void *)) TclpOpenFile -#define TclpLocaltime_unix (struct tm *(*) (const time_t *)) TclGetAndDetachPids -#define TclpGmtime_unix (struct tm *(*) (const time_t *)) TclpCloseFile - #else /* UNIX and MAC */ # define TclpLocaltime_unix TclpLocaltime # define TclpGmtime_unix TclpGmtime -- cgit v0.12 From df2aa14a4b12e5a43e8e757268e95e153cc31fdb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 10 Sep 2012 13:24:22 +0000 Subject: fix running package-tests on Windows, correct TCLSH_PROG in this case --- win/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/Makefile.in b/win/Makefile.in index 392bd7a..4dbdbbd 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -786,7 +786,7 @@ test-packages: tcltest packages pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ]; then \ echo "Testing package '$$pkg'"; \ - ( cd $(PKG_DIR)/$$pkg; $(MAKE) "LD_LIBRARY_PATH=$$builddir:${LD_LIBRARY_PATH}" "TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" "TCLLIBPATH=$$builddir/pkgs" test "TCLSH_PROG=$$builddir/tcltest"; ) \ + ( cd $(PKG_DIR)/$$pkg; $(MAKE) "LD_LIBRARY_PATH=$$builddir:${LD_LIBRARY_PATH}" "TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" "TCLLIBPATH=$$builddir/pkgs" test "TCLSH_PROG=$$builddir/${TCLSH}"; ) \ fi; \ fi; \ done; \ -- cgit v0.12 From 3110959c6f9095d249c2991f9f41fb27fa900c1a Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 11 Sep 2012 14:07:27 +0000 Subject: 3564735 Protect against mem corruption when var resolvers misbehave. --- generic/tclInt.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 53a88d6..6c6e664 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -801,13 +801,17 @@ typedef struct VarInHash { #define TclSetVarNamespaceVar(varPtr) \ if (!TclIsVarNamespaceVar(varPtr)) {\ (varPtr)->flags |= VAR_NAMESPACE_VAR;\ - ((VarInHash *)(varPtr))->refCount++;\ + if (TclIsVarInHash(varPtr)) {\ + ((VarInHash *)(varPtr))->refCount++;\ + }\ } #define TclClearVarNamespaceVar(varPtr) \ if (TclIsVarNamespaceVar(varPtr)) {\ (varPtr)->flags &= ~VAR_NAMESPACE_VAR;\ - ((VarInHash *)(varPtr))->refCount--;\ + if (TclIsVarInHash(varPtr)) {\ + ((VarInHash *)(varPtr))->refCount--;\ + }\ } /* -- cgit v0.12 From a7d4de2c279b775e84ac115f7b1450a31d5cd213 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 12 Sep 2012 19:11:29 +0000 Subject: finish the TIP 404 implementation. --- ChangeLog | 7 ++++--- changes | 6 ++++-- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 036cd21..d2017d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,10 @@ IMPLEMENTATION OF TIP#404. - * library/msgcat.tcl: [FRQ 3544988]: add commands - [mcflset] and [mcflmset] to set mc entries with implicit message file - locale. Package version is now 1.5.0. + * library/msgcat/msgcat.tcl: [FRQ 3544988]: New commands [mcflset] + * library/msgcat/pkgIndex.tcl: and [mcflmset] to set mc entries with + * unix/Makefile.in: implicit message file locale. + * win/Makefile.in: Bump to 1.5.0. 2012-08-25 Donal K. Fellows diff --git a/changes b/changes index 06b2db1..b902445 100644 --- a/changes +++ b/changes @@ -8092,7 +8092,6 @@ problems where [file *able] would return false results on Win/Samba (porter) and Tcl_FSMountsChanged(). (porter) 2012-06-29 (bug fix)[3536888] fix locale guessing (oehlmann,nijtmans) -=> msgcat 1.4.5 2012-07-05 (bug fix)[1189293] make "<<" redirect binary safe (porter) @@ -8109,8 +8108,11 @@ and Tcl_FSMountsChanged(). (porter) 2012-08-25 (bug fix)[3561330] Ukranian translation of "March" (teterin) +2012-09-12 (TIP 404) New msgcat commands [mcflset], [mcflmset] (oehlmann) +=> msgcat 1.5.0 + Many revisions to better support a Cygwin environment (nijtmans) Dropped support for OS X versions less than 10.4 (Tiger) (fellows) ---- Released 8.6b3, September 7, 2012 --- See ChangeLog for details --- +--- Released 8.6b3, September 18, 2012 --- See ChangeLog for details --- diff --git a/unix/Makefile.in b/unix/Makefile.in index 4d5595d..9ac84f7 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -846,8 +846,8 @@ install-libraries: libraries do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \ done; - @echo "Installing package msgcat 1.4.5 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.5.tm; + @echo "Installing package msgcat 1.5.0 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.5.0.tm; @echo "Installing package tcltest 2.3.4 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.4.tm; diff --git a/win/Makefile.in b/win/Makefile.in index 4dbdbbd..bef71c0 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -647,8 +647,8 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \ done; - @echo "Installing package msgcat 1.4.5 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.5.tm; + @echo "Installing package msgcat 1.5.0 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.5.0.tm; @echo "Installing package tcltest 2.3.4 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.4.tm; @echo "Installing package platform 1.0.10 as a Tcl Module"; -- cgit v0.12 From fa34cf0e225eb594debfdac2da4f6dd6df451418 Mon Sep 17 00:00:00 2001 From: twylite Date: Thu, 13 Sep 2012 09:02:52 +0000 Subject: 3549770 fix filesystem-7.1.x tests: loaddll constraint setup and path for filesystem-7.1.1 --- tests/fileSystem.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 38ecbee..b098f35 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -27,7 +27,7 @@ catch { set ::ddelib [lindex [package ifneeded dde $::ddever] 1] set ::regver [package require registry] set ::reglib [lindex [package ifneeded registry $::regver] 1] - testConstraint loaddll 0 + testConstraint loaddll 1 } # Test for commands defined in Tcltest executable @@ -514,7 +514,7 @@ test filesystem-7.1.1 {load from vfs} -setup { set dir [pwd] } -constraints {win testsimplefilesystem loaddll} -body { # This may cause a crash on exit - cd [file dirname $::reglib] + cd [file dirname $::ddelib] testsimplefilesystem 1 # This loads dde via a complex copy-to-temp operation load simplefs:/[file tail $::ddelib] dde -- cgit v0.12 From 98237732ef4cd07a63f32adcdbcdb4d0b9099773 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Sep 2012 12:34:37 +0000 Subject: 3566106 Solaris9/x86 support. Thanks Dagobert and others. --- unix/tcl.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index a142baf..b13fddd 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1968,7 +1968,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AS_IF([test "$GCC" = yes],[use_sunmath=no],[ arch=`isainfo` AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) - AS_IF([test "$arch" = "amd64 i386"], [ + AS_IF([test "$arch" = "amd64 i386" -o "$arch" = "i386"], [ AC_MSG_RESULT([yes]) MATH_LIBS="-lsunmath $MATH_LIBS" AC_CHECK_HEADER(sunmath.h) @@ -2001,7 +2001,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ], [ AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) case $system in - SunOS-5.[[1-9]][[0-9]]*) + SunOS-5.[[1-9]][[0-9]]*|SunOS-5.[[7-9]]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; -- cgit v0.12 From 5b68c7d62cf67a00bd6c5e97f1da7d7fd194ef00 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 13 Sep 2012 13:09:17 +0000 Subject: Fix msgcat-0.7 when running tests outside of the build tree (part of Bug #3549770) --- tests/msgcat.test | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/msgcat.test b/tests/msgcat.test index d75bf8e..0edb1d2 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -56,6 +56,13 @@ namespace eval ::msgcat::test { set result [string tolower \ [msgcat::ConvertLocale $::tcl::mac::locale]] } else { + if {([info sharedlibextension] == ".dll") + && ![catch {package require registry}]} { + # Windows and Cygwin have other ways to determine the + # locale when the environment variables are missing + # and the registry package is present + continue + } set result c } } -- cgit v0.12 From 8514777f826612d38687d5c42e5a4283930ea9a3 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Sep 2012 14:17:18 +0000 Subject: Revert committed debugging configuration. --- generic/tclInt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index a0629c6..6c6e664 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4640,7 +4640,7 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn)); *---------------------------------------------------------------- */ -#define NRE_USE_SMALL_ALLOC 0 /* Only turn off for debugging purposes. */ +#define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */ #define NRE_ENABLE_ASSERTS 1 /* -- cgit v0.12 From 6222630e1575db9c7d632eac2ac4587292ef94f1 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Sep 2012 15:34:11 +0000 Subject: First draft of tcl/pkgs/README bundling instructions. --- pkgs/README | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/pkgs/README b/pkgs/README index e2b33f5..01c6f43 100644 --- a/pkgs/README +++ b/pkgs/README @@ -1 +1,57 @@ -Add notes here about bundling packages with Tcl. + +The 'pkgs' subdirectory of the Tcl source code distribution is meant to be +a place where the source code distribution of Tcl packages may be placed so +that they are built, installed, and tested along with Tcl. As originally +distributed, Tcl re-distributes a number of packages in this location. The +build systems for Tcl are written so that additional packages may be added, +or the original packages removed in any number and still have all packages +present get built, installed, and tested along with Tcl. + +In order for a package to work properly under the pkgs subdirectory, it +needs to conform to the following conventions. + + All files of the package need to be contained in (subdirs of ...) a + single subdirectory of the "pkgs" directrory. + + In that subdirectory of "pkgs" there must be an executable file named + "configure". When the program "configure" is run, it should generate + a file "Makefile" in the current working directory. The "configure" + program should be able to accept as command line arguments all the + arguments that can be passed to the master unix/configure program. It + should also accept the --with-tcl= and --with-tclinclude= options in + the conventional way. + + The generated "Makefile" must be one suitable for controlling the operations + of a `make` program. The following targets must be defined: + + : Perform a build of the runtime components of the + package from sources. + + install: Copy the runtime components of the package into their + installed location. Must respect the DESTDIR variable + for determining the installation location. + + test: Run the test suite of the package. Must respect the + TCLSH_PROG, TESTFLAGS variables. + + clean: Delete all files generated by the default build target. + + distclean: Delete all generated files. + + dist: Produce a copy of the package's source code distribution. + Must respect the DIST_ROOT variable determing where to + write the generated directory. + +Packages that are written to make use of the Tcl Extension Architecture (TEA) +and that make use of the tclconfig collection of support files, should +conform to these conventions without further efforts. + +These conventions are subject to revision and refinement over time to +better support the needs of the build system. Efforts will be made to +keep the TEA support scripts consistent with the demands of this system. + +In addition, it is requested that packages also support building with +Microsoft Visual Studio tools. This means the file win/makefile.vc +should be included, suitable for use by the nmake program, defining the +targets , install, test, and clean. + -- cgit v0.12 From 158e7897249b7ff3ac5bba76020895f7d5d90d8e Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Sep 2012 15:54:52 +0000 Subject: autoconf-2.59 --- unix/configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 18611f0..3e247c7 100755 --- a/unix/configure +++ b/unix/configure @@ -8757,7 +8757,7 @@ else arch=`isainfo` echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6 - if test "$arch" = "amd64 i386"; then + if test "$arch" = "amd64 i386" -o "$arch" = "i386"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 @@ -8956,7 +8956,7 @@ else fi case $system in - SunOS-5.[1-9][0-9]*) + SunOS-5.[1-9][0-9]*|SunOS-5.[7-9]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; -- cgit v0.12 From e684cc19d11b76f4bbe0b3540577963563f3e948 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Sep 2012 16:19:19 +0000 Subject: Safer stale config fix for review. --- unix/configure | 5 ++++- unix/configure.in | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 0958d3d..cbb10b4 100755 --- a/unix/configure +++ b/unix/configure @@ -1355,7 +1355,10 @@ fi #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ -rm -Rf pkgs +#rm -Rf pkgs +if test -f Makefile; then + make distclean-packages +fi #------------------------------------------------------------------------ # Handle the --prefix=... option diff --git a/unix/configure.in b/unix/configure.in index 420cdc2..f4b695d 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -45,7 +45,10 @@ fi #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ -rm -Rf pkgs +#rm -Rf pkgs +if test -f Makefile; then + make distclean-packages +fi #------------------------------------------------------------------------ # Handle the --prefix=... option -- cgit v0.12 From d097d2d5afb8aac0a3913ad7f4af6726025c6dc2 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 14 Sep 2012 18:15:54 +0000 Subject: Missing test cleanup. --- tests/ioTrans.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ioTrans.test b/tests/ioTrans.test index db9a2cb..7027ec1 100644 --- a/tests/ioTrans.test +++ b/tests/ioTrans.test @@ -283,6 +283,8 @@ test iortrans-3.1 {chan finalize, handler destruction has no effect on channel} lappend res [catch {close $c} msg] $msg lappend res [file channels file*] lappend res [file channels rt*] +} -cleanup { + tempdone } -result {{initialize rt* {read write}} file* file* {} 1 {invalid command name "foo"} {} {}} test iortrans-3.2 {chan finalize, for close} -setup { set res {} @@ -300,6 +302,7 @@ test iortrans-3.2 {chan finalize, for close} -setup { lappend res [info command foo] } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} {} foo} test iortrans-3.3 {chan finalize, for close, error, close error} -setup { set res {} @@ -315,6 +318,7 @@ test iortrans-3.3 {chan finalize, for close, error, close error} -setup { lappend res [file channels rt*] } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 5 {}} test iortrans-3.4 {chan finalize, for close, error, close error} -setup { set res {} @@ -328,6 +332,7 @@ test iortrans-3.4 {chan finalize, for close, error, close error} -setup { lappend res [catch {close $c} msg] $msg $::errorInfo } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 FOO {FOO *"close $c"}} test iortrans-3.5 {chan finalize, for close, arbitrary result, ignored} -setup { @@ -342,6 +347,7 @@ test iortrans-3.5 {chan finalize, for close, arbitrary result, ignored} -setup { lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 0 {}} test iortrans-3.6 {chan finalize, for close, break, close error} -setup { set res {} @@ -355,6 +361,7 @@ test iortrans-3.6 {chan finalize, for close, break, close error} -setup { lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans-3.7 {chan finalize, for close, continue, close error} -setup { set res {} @@ -368,6 +375,7 @@ test iortrans-3.7 {chan finalize, for close, continue, close error} -setup { lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans-3.8 {chan finalize, for close, custom code, close error} -setup { set res {} @@ -381,6 +389,7 @@ test iortrans-3.8 {chan finalize, for close, custom code, close error} -setup { lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans-3.9 {chan finalize, for close, ignore level, close error} -setup { set res {} @@ -395,6 +404,7 @@ test iortrans-3.9 {chan finalize, for close, ignore level, close error} -setup { noteOpts $opt } -match glob -cleanup { rename foo {} + tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "finalize"*}} # --- === *** ########################### @@ -1036,6 +1046,8 @@ test iortrans-11.2 {delete interp of reflected transform} -setup { chan event $c readable no-op } interp delete slave +} -cleanup { + tempdone } -result {} # ### ### ### ######### ######### ######### -- cgit v0.12 From 18b6945d86ecf2b58a0d39e7f17885f692f19a87 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 14 Sep 2012 18:20:36 +0000 Subject: Mistaken cleanup command. --- tests/msgcat.test | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/msgcat.test b/tests/msgcat.test index 0edb1d2..1522354 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -655,7 +655,6 @@ namespace eval ::msgcat::test { removeFile l2.msg $msgdir2 removeDirectory msgdir2 - removeFile l3.msg $msgdir3 removeDirectory msgdir3 cleanupTests -- cgit v0.12 From 0807baacce4a33e3515110feb33689c90b397f80 Mon Sep 17 00:00:00 2001 From: stwo Date: Sun, 16 Sep 2012 15:51:55 +0000 Subject: Nicer style test. --- generic/tclBinary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 4953e27..cbd9b02 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -309,10 +309,10 @@ Tcl_SetByteArrayObj( byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length)); byteArrayPtr->used = length; byteArrayPtr->allocated = length; - if (length && bytes) { + + if ((length != NULL) && (bytes > 0)) { memcpy(byteArrayPtr->bytes, bytes, (size_t) length); } - objPtr->typePtr = &tclByteArrayType; SET_BYTEARRAY(objPtr, byteArrayPtr); } -- cgit v0.12 From 4cbd189c26149481fffd935920221b8e3a0c7b2e Mon Sep 17 00:00:00 2001 From: stwo Date: Sun, 16 Sep 2012 15:56:02 +0000 Subject: Nicer style test. --- generic/tclBinary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 8c95305..d3b11d3 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -279,10 +279,10 @@ Tcl_SetByteArrayObj( byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length)); byteArrayPtr->used = length; byteArrayPtr->allocated = length; - if (length && bytes) { + + if ((length != NULL) && (bytes > 0)) { memcpy(byteArrayPtr->bytes, bytes, (size_t) length); } - objPtr->typePtr = &tclByteArrayType; SET_BYTEARRAY(objPtr, byteArrayPtr); } -- cgit v0.12 From f0b29ca5582f739d333f185cf4cd0be2432025b5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 17 Sep 2012 10:45:47 +0000 Subject: eliminate compiler warning in previous commit --- generic/tclBinary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index d3b11d3..9ba06ee 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -280,7 +280,7 @@ Tcl_SetByteArrayObj( byteArrayPtr->used = length; byteArrayPtr->allocated = length; - if ((length != NULL) && (bytes > 0)) { + if ((bytes != NULL) && (length > 0)) { memcpy(byteArrayPtr->bytes, bytes, (size_t) length); } objPtr->typePtr = &tclByteArrayType; -- cgit v0.12 From 08483415eb549c433b52c30f5b7c5b3166549bbd Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 17 Sep 2012 12:56:32 +0000 Subject: Tag Tcl 8.6b3 for release. --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index d2017d4..2360718 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2012-09-07 Harald Oehlmann + *** 8.6b3 TAGGED FOR RELEASE *** + IMPLEMENTATION OF TIP#404. * library/msgcat/msgcat.tcl: [FRQ 3544988]: New commands [mcflset] -- cgit v0.12 From 87baa038943501504fc76d2f330ad6987b384602 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 19 Sep 2012 09:50:25 +0000 Subject: Make Tcl_Interp a fully opaque structure if TCL_NO_DEPRECATED is set (TIP 330 and 336). --- ChangeLog | 5 +++++ generic/tcl.h | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2360718..b6addcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-19 Jan Nijtmans + + * generic/tcl.h: make Tcl_Interp a fully opaque structure + if TCL_NO_DEPRECATED is set (TIP 330 and 336). + 2012-09-07 Harald Oehlmann *** 8.6b3 TAGGED FOR RELEASE *** diff --git a/generic/tcl.h b/generic/tcl.h index 32d8e1e..3f9f06a 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -500,7 +500,9 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). */ -typedef struct Tcl_Interp { +typedef struct Tcl_Interp +#ifndef TCL_NO_DEPRECATED +{ /* TIP #330: Strongly discourage extensions from using the string * result. */ #ifdef USE_INTERP_RESULT @@ -517,8 +519,8 @@ typedef struct Tcl_Interp { * Tcl_Eval must free it before executing next * command. */ #else - char *unused3 TCL_DEPRECATED_API("bad field access"); - void (*unused4) (char *) TCL_DEPRECATED_API("bad field access"); + char *resultDontUse; /* Don't use in extensions! */ + void (*freeProcDontUse) (char *); /* Don't use in extensions! */ #endif #ifdef USE_INTERP_ERRORLINE int errorLine TCL_DEPRECATED_API("use Tcl_GetErrorLine/Tcl_SetErrorLine"); @@ -526,9 +528,11 @@ typedef struct Tcl_Interp { * line number within the command where the * error occurred (1 if first line). */ #else - int unused5 TCL_DEPRECATED_API("bad field access"); + int errorLineDontUse; /* Don't use in extensions! */ #endif -} Tcl_Interp; +} +#endif /* TCL_NO_DEPRECATED */ +Tcl_Interp; typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; typedef struct Tcl_Channel_ *Tcl_Channel; -- cgit v0.12 From 562176ad5a881a5f92f2985feab5401c375d559a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 19 Sep 2012 12:33:25 +0000 Subject: Let "nmakehlp -V" start searching digits after the found match (suggested by Harald Oehlmann) --- ChangeLog | 4 +++- win/nmakehlp.c | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6addcc..9a17845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 2012-09-19 Jan Nijtmans - * generic/tcl.h: make Tcl_Interp a fully opaque structure + * generic/tcl.h: make Tcl_Interp a fully opaque structure if TCL_NO_DEPRECATED is set (TIP 330 and 336). + * win/nmakehlp.c: Let "nmakehlp -V" start searching digits + after the found match (suggested by Harald Oehlmann) 2012-09-07 Harald Oehlmann diff --git a/win/nmakehlp.c b/win/nmakehlp.c index d0edcf0..b1a1517 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -498,9 +498,10 @@ GetVersionFromFile( p = strstr(szBuffer, match); if (p != NULL) { /* - * Skip to first digit. + * Skip to first digit after the match. */ + p += strlen(match); while (*p && !isdigit(*p)) { ++p; } @@ -630,11 +631,11 @@ SubstituteFile( } } #endif - + /* * Run the substitutions over each line of the input */ - + while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { @@ -654,7 +655,7 @@ SubstituteFile( } printf(szBuffer); } - + list_free(&substPtr); } fclose(fp); -- cgit v0.12