12#include "attributes.h"
20#pragma GCC diagnostic push
21#pragma GCC diagnostic ignored "-Wredundant-decls"
23NORETURN
extern int lua_error( lua_State *L );
24NORETURN
extern int luaL_error( lua_State *L,
const char *fmt, ... );
25NORETURN
extern int luaL_typerror( lua_State *L,
int narg,
const char *tname );
27#pragma GCC diagnostic pop
33#define NLUA_DEBUG(str, args...) \
34 (DEBUG("Lua: "str"\n", ## args), abort())
36#define NLUA_DEBUG(str, args...) \
37 (DEBUG("Lua: "str"\n", ## args))
39#define NLUA_INVALID_PARAMETER(L) \
41 DEBUG( "Invalid parameter for %s.", __func__ ); \
42 luaL_error( L, "Invalid parameter for %s.", __func__ ); \
45#define NLUA_MIN_ARGS(n) \
46 if (lua_gettop(L) < n) { \
47 DEBUG( "Too few arguments for %s.", __func__ ); \
48 luaL_error( L, "Too few arguments for %s.", __func__ ); \
55#define NLUA_ERROR(L,str, args...) (luaL_error(L,str, ## args))