aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-08-09 14:57:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-08-09 14:57:29 -0300
commitbbfd28959d0c3e93eea163ad3ac24c24c89f43bf (patch)
tree62506c0c6b301bbbb98342bdb5b7e2d7fcbce5a7
parent894cd31c5227fd4061f6eb2bd6140c540946d394 (diff)
downloadlua-bbfd28959d0c3e93eea163ad3ac24c24c89f43bf.tar.gz
lua-bbfd28959d0c3e93eea163ad3ac24c24c89f43bf.tar.bz2
lua-bbfd28959d0c3e93eea163ad3ac24c24c89f43bf.zip
attempt to better control use of _longjmp
-rw-r--r--luaconf.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/luaconf.h b/luaconf.h
index 8e44b16b..650ee8cf 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.56 2005/08/01 15:05:09 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.57 2005/08/04 13:37:10 roberto Exp roberto $
3** Configuration file for Lua 3** Configuration file for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -548,10 +548,10 @@ union luai_Cast { double l_d; long l_l; };
548 548
549/* 549/*
550@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling. 550@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.
551** CHANGE them if you prefer to use longjmp/setjmp even with C++ or 551** CHANGE them if you prefer to use longjmp/setjmp even with C++
552** if want/don't want to use _longjmp/_setjmp instead of regular 552** or if want/don't to use _longjmp/_setjmp instead of regular
553** longjmp/setjmp. By default, Lua handles errors with exceptions when 553** longjmp/setjmp. By default, Lua handles errors with exceptions when
554* compiling as C++ code, with _longjmp/_setjmp when compiling as C code 554** compiling as C++ code, with _longjmp/_setjmp when compiling as C code
555** in some Unix systems, and with longjmp/setjmp otherwise. 555** in some Unix systems, and with longjmp/setjmp otherwise.
556*/ 556*/
557#if defined(__cplusplus) 557#if defined(__cplusplus)
@@ -561,8 +561,7 @@ union luai_Cast { double l_d; long l_l; };
561 { if ((c)->status == 0) (c)->status = -1; } 561 { if ((c)->status == 0) (c)->status = -1; }
562#define luai_jmpbuf int /* dummy variable */ 562#define luai_jmpbuf int /* dummy variable */
563 563
564#elif !defined(LUA_ANSI) && (defined(unix) || defined(__unix) || \ 564#elif !defined(LUA_ANSI) && (defined(__GLIBC__))
565 defined(__unix__))
566/* in Unix, try _longjmp/_setjmp (more efficient) */ 565/* in Unix, try _longjmp/_setjmp (more efficient) */
567#define LUAI_THROW(L,c) _longjmp((c)->b, 1) 566#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
568#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } 567#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }