diff options
author | Mike Pall <mike> | 2010-12-01 12:54:32 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-12-01 12:54:32 +0100 |
commit | d98cd19bb026cacfca6711ada2495b2e7aefd417 (patch) | |
tree | 663cc83ab8568dfcf8f1521acf1fc5f66e47d81b /src | |
parent | 0ffd06aba8de49ce751e5e9bcf7aa71bd42403f1 (diff) | |
download | luajit-d98cd19bb026cacfca6711ada2495b2e7aefd417.tar.gz luajit-d98cd19bb026cacfca6711ada2495b2e7aefd417.tar.bz2 luajit-d98cd19bb026cacfca6711ada2495b2e7aefd417.zip |
Allow access to raw error messages from outside lj_err.c.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_err.c | 4 | ||||
-rw-r--r-- | src/lj_err.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lj_err.c b/src/lj_err.c index 0d5aa683..562697ad 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
@@ -72,13 +72,11 @@ | |||
72 | /* -- Error messages ------------------------------------------------------ */ | 72 | /* -- Error messages ------------------------------------------------------ */ |
73 | 73 | ||
74 | /* Error message strings. */ | 74 | /* Error message strings. */ |
75 | static const char *lj_err_allmsg = | 75 | LJ_DATADEF const char *lj_err_allmsg = |
76 | #define ERRDEF(name, msg) msg "\0" | 76 | #define ERRDEF(name, msg) msg "\0" |
77 | #include "lj_errmsg.h" | 77 | #include "lj_errmsg.h" |
78 | ; | 78 | ; |
79 | 79 | ||
80 | #define err2msg(em) (lj_err_allmsg+(int)(em)) | ||
81 | |||
82 | /* -- Frame and function introspection ------------------------------------ */ | 80 | /* -- Frame and function introspection ------------------------------------ */ |
83 | 81 | ||
84 | static BCPos currentpc(lua_State *L, GCfunc *fn, cTValue *nextframe) | 82 | static BCPos currentpc(lua_State *L, GCfunc *fn, cTValue *nextframe) |
diff --git a/src/lj_err.h b/src/lj_err.h index 4c5213b6..cd5d4f4d 100644 --- a/src/lj_err.h +++ b/src/lj_err.h | |||
@@ -17,6 +17,9 @@ typedef enum { | |||
17 | LJ_ERR__MAX | 17 | LJ_ERR__MAX |
18 | } ErrMsg; | 18 | } ErrMsg; |
19 | 19 | ||
20 | LJ_DATA const char *lj_err_allmsg; | ||
21 | #define err2msg(em) (lj_err_allmsg+(int)(em)) | ||
22 | |||
20 | LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); | 23 | LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); |
21 | LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); | 24 | LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); |
22 | LJ_FUNC_NORET void lj_err_mem(lua_State *L); | 25 | LJ_FUNC_NORET void lj_err_mem(lua_State *L); |