summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index e4ba0f2..9202c26 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -7,7 +7,7 @@
* Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclUnixInit.c,v 1.77 2007/11/10 20:49:21 das Exp $
+ * RCS: @(#) $Id: tclUnixInit.c,v 1.78 2007/11/10 22:24:14 msofer Exp $
*/
#include "tclInt.h"
@@ -81,8 +81,14 @@ typedef struct ThreadSpecificData {
int *stackBound; /* The current stack boundary */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+#ifdef TCL_CROSS_COMPILE
static int stackGrowsDown = -1;
static int StackGrowsDown(int *parent);
+#elif defined(TCL_STACK_GROWS_UP)
+static int stackGrowsDown = 0;
+#else
+static int stackGrowsDown = 1;
+#endif
#endif /* TCL_NO_STACK_CHECK */
#ifdef TCL_DEBUG_STACK_CHECK
@@ -1035,7 +1041,7 @@ TclpGetCStackParams(
/* Most variables are actually in a
* thread-specific data block to minimise the
* impact on the stack. */
-
+#ifdef TCL_CROSS_COMPILE
if (stackGrowsDown == -1) {
/*
* Not initialised!
@@ -1043,7 +1049,8 @@ TclpGetCStackParams(
stackGrowsDown = StackGrowsDown(&result);
}
-
+#endif
+
/*
* The first time through in a thread: record the "outermost" stack
* frame and inquire with the OS about the stack size.
@@ -1094,6 +1101,7 @@ TclpGetCStackParams(
return stackGrowsDown;
}
+#ifdef TCL_CROSS_COMPILE
int
StackGrowsDown(
int *parent)
@@ -1102,6 +1110,7 @@ StackGrowsDown(
return (&here < parent);
}
#endif
+#endif
/*