diff options
author | Chris Apers | 2004-09-12 11:27:36 +0000 |
---|---|---|
committer | Chris Apers | 2004-09-12 11:27:36 +0000 |
commit | 3a89406b76efee69496d1620fc5111949ff11e00 (patch) | |
tree | 6afc3ad1447f26b1d52bafe09105d1324babee23 /backends | |
parent | a1c22f9d7f823bef55be5c2c31e5d963ac29c8d6 (diff) | |
download | scummvm-rg350-3a89406b76efee69496d1620fc5111949ff11e00.tar.gz scummvm-rg350-3a89406b76efee69496d1620fc5111949ff11e00.tar.bz2 scummvm-rg350-3a89406b76efee69496d1620fc5111949ff11e00.zip |
New exit(...) function
svn-id: r15030
Diffstat (limited to 'backends')
-rw-r--r-- | backends/PalmOS/Src/missing/_stdlib.cpp | 8 | ||||
-rw-r--r-- | backends/PalmOS/Src/missing/stdlib.h | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/backends/PalmOS/Src/missing/_stdlib.cpp b/backends/PalmOS/Src/missing/_stdlib.cpp index 0c89ecd0d9..3b8bdb4b62 100644 --- a/backends/PalmOS/Src/missing/_stdlib.cpp +++ b/backends/PalmOS/Src/missing/_stdlib.cpp @@ -80,11 +80,15 @@ MemPtr realloc(MemPtr oldP, UInt32 size) { return newP; } +ErrJumpBuf stdlib_errJumpBuf; +#define ERR_MAGIC 0xDADA + void exit(Int16 status) { - // need to change this EventType event; event.eType = keyDownEvent; event.data.keyDown.chr = vchrLaunch; event.data.keyDown.modifiers = commandKeyMask; - EvtAddUniqueEventToQueue (&event, 0, true); + EvtAddUniqueEventToQueue(&event, 0, true); + + ErrLongJump(stdlib_errJumpBuf, status == 0 ? 0xDADA : status); } diff --git a/backends/PalmOS/Src/missing/stdlib.h b/backends/PalmOS/Src/missing/stdlib.h index 5d0337dac2..6448ee390e 100644 --- a/backends/PalmOS/Src/missing/stdlib.h +++ b/backends/PalmOS/Src/missing/stdlib.h @@ -26,6 +26,11 @@ #include <PalmOS.h> #include "MemGlue.h" +extern ErrJumpBuf stdlib_errJumpBuf; + +#define DO_EXIT( code ) \ + if (ErrSetJump(stdlib_errJumpBuf) == 0) { code } + #define atoi StrAToI #define atol StrAToI #define abs(a) ((a) < 0 ? -(a) : (a)) |