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 @@ /* -- Error messages ------------------------------------------------------ */ /* Error message strings. */ -static const char *lj_err_allmsg = +LJ_DATADEF const char *lj_err_allmsg = #define ERRDEF(name, msg) msg "\0" #include "lj_errmsg.h" ; -#define err2msg(em) (lj_err_allmsg+(int)(em)) - /* -- Frame and function introspection ------------------------------------ */ 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 { LJ_ERR__MAX } ErrMsg; +LJ_DATA const char *lj_err_allmsg; +#define err2msg(em) (lj_err_allmsg+(int)(em)) + LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); LJ_FUNC_NORET void lj_err_mem(lua_State *L);