summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authormdejong <mdejong>2002-03-08 01:45:51 (GMT)
committermdejong <mdejong>2002-03-08 01:45:51 (GMT)
commit12d2dcaa42dce1168e5487ead798a7486e0c4f8a (patch)
treeb1bc8f3cb80b121d126f7bf0f4cb96a6bc14e98d /win/tclWin32Dll.c
parent55889909abdf66ad1c7b86b10244d9dd09cc46e2 (diff)
downloadtcl-12d2dcaa42dce1168e5487ead798a7486e0c4f8a.zip
tcl-12d2dcaa42dce1168e5487ead798a7486e0c4f8a.tar.gz
tcl-12d2dcaa42dce1168e5487ead798a7486e0c4f8a.tar.bz2
* win/tclWin32Dll.c (TclpCheckStackSpace):
* win/tclWinFCmd.c (DoRenameFile, DoCopyFile): Replace hard coded constants with Win32 symbolic names. Move control flow statements out of __try blocks since the documentation indicates it is frowned upon.
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 6ab2545..dde720e 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWin32Dll.c,v 1.13 2002/02/08 02:52:54 dgp Exp $
+ * RCS: @(#) $Id: tclWin32Dll.c,v 1.14 2002/03/08 01:45:52 mdejong Exp $
*/
#include "tclWinInt.h"
@@ -340,6 +340,8 @@ TclWinNoBackslash(
int
TclpCheckStackSpace()
{
+ int retval = 0;
+
/*
* We can recurse only if there is at least TCL_WIN_STACK_THRESHOLD
* bytes of stack space left. alloca() is cheap on windows; basically
@@ -349,10 +351,13 @@ TclpCheckStackSpace()
__try {
alloca(TCL_WIN_STACK_THRESHOLD);
- return 1;
- } __except (1) {}
+ retval = 1;
+ } __except (EXCEPTION_EXECUTE_HANDLER) {}
- return 0;
+ /*
+ * Avoid using control flow statements in the SEH guarded block!
+ */
+ return retval;
}