13#include "attributes.h"
24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wredundant-decls"
27NORETURN
extern int lua_error( lua_State *L );
28NORETURN
extern int luaL_error( lua_State *L,
const char *fmt, ... );
29NORETURN
extern int luaL_typerror( lua_State *L,
int narg,
const char *tname );
31#pragma GCC diagnostic pop
37#define NLUA_DEBUG(str, ...) \
38 (DEBUG("Lua: "str"\n", ## __VA_ARGS__), abort())
40#define NLUA_DEBUG(str, ...) \
41 (DEBUG("Lua: "str"\n", ## __VA_ARGS__))
43#define NLUA_INVALID_PARAMETER(L,idx) \
45 DEBUG( "Invalid parameter %d for %s.", idx, __func__ ); \
46 return luaL_error( L, "Invalid parameter %d for %s.", idx, __func__ ); \
48#define NLUA_INVALID_PARAMETER_NORET(L,idx) \
50 DEBUG( "Invalid parameter %d for %s.", idx, __func__ ); \
51 luaL_error( L, "Invalid parameter %d for %s.", idx, __func__ ); \
53#define NLUA_MIN_ARGS(n) \
54 if (lua_gettop(L) < n) { \
55 DEBUG( "Too few arguments for %s.", __func__ ); \
56 return luaL_error( L, "Too few arguments for %s.", __func__ ); \
62#define NLUA_ERROR(L,str, ...) (luaL_error(L,str, ## __VA_ARGS__))