From d1ecdfc510d012c8bdaee81575dee3e81d19caec Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 2 Jan 2006 13:32:16 +0000 Subject: [PATCH] Fix the persisent IRIX bug. --- simgear/nasal/code.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/simgear/nasal/code.c b/simgear/nasal/code.c index 871bad06..9e5907f6 100644 --- a/simgear/nasal/code.c +++ b/simgear/nasal/code.c @@ -200,10 +200,18 @@ void naFreeContext(struct Context* c) UNLOCK(); } -#define PUSH(r) do { \ +#if !defined(sgi) +# define PUSH(r) do { \ if(ctx->opTop >= MAX_STACK_DEPTH) ERR(ctx, "stack overflow"); \ ctx->opStack[ctx->opTop++] = r; \ - } while(0) + } while(0); +#else +# define PUSH(r) _PUSH((ctx), (r)) +void _PUSH(struct Context* ctx, naRef r) { + if(ctx->opTop >= MAX_STACK_DEPTH) ERR(ctx, "stack overflow"); + ctx->opStack[ctx->opTop++] = r; +} +#endif static void setupArgs(naContext ctx, struct Frame* f, naRef* args, int nargs) { -- 2.39.5