summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 22:24:12 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 22:24:12 (GMT)
commit6e7b0d042d8e2395df7a6408768fde12c23abdae (patch)
tree566675aa0f9a8b20448e3bc3c1b1726ad3c82f0e /generic/tclBasic.c
parentdb8435f4f6d903ab177a991ed393676493928b77 (diff)
downloadtcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.zip
tcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.tar.gz
tcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.tar.bz2
* generic/tclBasic.c:
* unix/configure.in: * unix/tclUnixInit.c: detect stack grwoth direction at compile time, only fall to runtime detection when crosscompiling.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 893de64..e8faad0 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.275 2007/11/10 20:05:34 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.276 2007/11/10 22:24:13 msofer Exp $
*/
#include "tclInt.h"
@@ -334,21 +334,32 @@ static const OpCmdInfo mathOpCmds[] = {
{0}, NULL }
};
-#ifndef TCL_NO_STACK_CHECK
+#ifdef TCL_NO_STACK_CHECK
+/* stack check disabled: make them noops */
+#define CheckCStack(interp, localIntPtr) 1
+#define GetCStackParams(iPtr)
+#else /* TCL_NO_STACK_CHECK */
+#ifdef TCL_CROSS_COMPILE
static int stackGrowsDown = 1;
-
#define GetCStackParams(iPtr) \
stackGrowsDown = TclpGetCStackParams(&((iPtr)->stackBound))
-
#define CheckCStack(iPtr, localIntPtr) \
(stackGrowsDown \
? ((localIntPtr) > (iPtr)->stackBound) \
: ((localIntPtr) < (iPtr)->stackBound) \
)
-#else /* stack check disabled: make them noops */
-#define CheckCStack(interp, localIntPtr) 1
-#define GetCStackParams(iPtr)
-#endif
+#else /* TCL_CROSS_COMPILE */
+#define GetCStackParams(iPtr) \
+ TclpGetCStackParams(&((iPtr)->stackBound))
+#ifdef TCL_STACK_GROWS_UP
+#define CheckCStack(iPtr, localIntPtr) \
+ ((localIntPtr) < (iPtr)->stackBound)
+#else /* TCL_STACK_GROWS_UP */
+#define CheckCStack(iPtr, localIntPtr) \
+ ((localIntPtr) > (iPtr)->stackBound)
+#endif /* TCL_STACK_GROWS_UP */
+#endif /* TCL_CROSS_COMPILE */
+#endif /* TCL_NO_STACK_CHECK */
/*