summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-07-27 17:26:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-07-27 17:26:36 (GMT)
commit0800af49de60cffa651e222f74633f4aa1905863 (patch)
treea3e087b34e48d167b13004ef21901441c1435c40
parentf290555a7143813d38b1c606c489ee0d86844bbf (diff)
parentd7019b7df70dfd4375c7952850fe26f1bec79520 (diff)
downloadtcl-0800af49de60cffa651e222f74633f4aa1905863.zip
tcl-0800af49de60cffa651e222f74633f4aa1905863.tar.gz
tcl-0800af49de60cffa651e222f74633f4aa1905863.tar.bz2
merge to rc
-rw-r--r--ChangeLog12
-rw-r--r--generic/tclOO.c1
-rw-r--r--tests/oo.test19
-rw-r--r--win/tclWinPort.h4
4 files changed, 21 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index f327122..5d08170 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,16 @@
+2011-07-26 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tclOO.c (initScript): Ensure that TclOO is properly found by
+ all the various package mechanisms (by adding a dummy ifneeded script)
+ and not just some of them.
+
+2011-07-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tclWinPort.h: [Bug 3372130]: Fix hypot math function with MSVC10
+
2011-07-19 Don Porter <dgp@users.sourceforge.net>
- * generic/tclUtil.c: [Bug 3371644] Repair failure to properly handle
+ * generic/tclUtil.c: [Bug 3371644]: Repair failure to properly handle
* tests/util.test: (length == -1) scanning in TclConvertElement().
Thanks to Thomas Sader and Alexandre Ferrieux.
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 9df3f53..8b76eeb 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -130,6 +130,7 @@ static const DeclaredClassMethod objMethods[] = {
};
static char initScript[] =
+ "package ifneeded TclOO " TCLOO_PATCHLEVEL " {# Already present, OK?};"
"namespace eval ::oo { variable version " TCLOO_VERSION " };"
"namespace eval ::oo { variable patchlevel " TCLOO_PATCHLEVEL " };";
/* "tcl_findLibrary tcloo $oo::version $oo::version" */
diff --git a/tests/oo.test b/tests/oo.test
index e8f770c..b12cb42 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -2,7 +2,7 @@
# 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.
@@ -29,15 +29,9 @@ if {[testConstraint memory]} {
return [expr {$end - $tmp}]
}
}
-
-proc initInterpreter name {
- $name eval [list package ifneeded TclOO [package provide TclOO] \
- [package ifneeded TclOO [package provide TclOO]]]
-}
test oo-0.1 {basic test of OO's ability to clean up its initial state} {
interp create t
- initInterpreter t
t eval {
package require TclOO
}
@@ -45,11 +39,11 @@ test oo-0.1 {basic test of OO's ability to clean up its initial state} {
} {}
test oo-0.2 {basic test of OO's ability to clean up its initial state} {
set i [interp create]
- initInterpreter $i
interp eval $i {
package require TclOO
namespace delete ::
}
+ interp delete $i
} {}
test oo-0.3 {basic test of OO's ability to clean up its initial state} -body {
leaktest {
@@ -72,7 +66,6 @@ test oo-0.5 {testing literal leak on interp delete} memory {
} 0
test oo-0.6 {cleaning the core class pair; way #1} -setup {
interp create t
- initInterpreter t
} -body {
t eval {
package require TclOO
@@ -84,7 +77,6 @@ test oo-0.6 {cleaning the core class pair; way #1} -setup {
} -result {0 {} 1 {invalid command name "object"}}
test oo-0.7 {cleaning the core class pair; way #2} -setup {
interp create t
- initInterpreter t
} -body {
t eval {
package require TclOO
@@ -106,6 +98,10 @@ test oo-0.8 {leak in variable management} -setup {
} -cleanup {
foo destroy
} -result 0
+test oo-0.9 {various types of presence of the TclOO package} {
+ list [lsearch -nocase -all -inline [package names] tcloo] \
+ [package present TclOO] [package versions TclOO]
+} [list TclOO $::oo::version $::oo::version]
test oo-1.1 {basic test of OO functionality: no classes} {
set result {}
@@ -272,7 +268,6 @@ test oo-2.1 {basic test of OO functionality: constructor} -setup {
# This is a bit complex because it needs to run in a sub-interp as
# we're modifying the root object class's constructor
interp create subinterp
- initInterpreter subinterp
subinterp eval {
package require TclOO
}
@@ -340,7 +335,6 @@ test oo-3.1 {basic test of OO functionality: destructor} -setup {
# This is a bit complex because it needs to run in a sub-interp as we're
# modifying the root object class's constructor
interp create subinterp
- initInterpreter subinterp
subinterp eval {
package require TclOO
}
@@ -361,7 +355,6 @@ test oo-3.2 {basic test of OO functionality: destructor} -setup {
# This is a bit complex because it needs to run in a sub-interp as
# we're modifying the root object class's constructor
interp create subinterp
- initInterpreter subinterp
subinterp eval {
package require TclOO
}
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 4fe8754..ca58470 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -454,7 +454,9 @@
#if defined(_MSC_VER) || defined(__MINGW32__)
# define environ _environ
-# define hypot _hypot
+# if defined(_MSC_VER) && (_MSC_VER < 1600)
+# define hypot _hypot
+# endif
# define exception _exception
# undef EDEADLOCK
# if defined(__MINGW32__) && !defined(__MSVCRT__)