Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions common/luaclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define AWESOME_COMMON_LUACLASS

#include "common/signal.h"
#include "common/util.h"

#include <lua.h>
#include <lauxlib.h>
Expand Down Expand Up @@ -132,51 +133,51 @@ luaA_checkudataornil(lua_State *L, int udx, lua_class_t *class)
}

#define LUA_CLASS_FUNCS(prefix, lua_class) \
static inline int \
static inline int maybe_unused \
luaA_##prefix##_class_add_signal(lua_State *L) \
{ \
luaA_deprecate(L, "signal usage without add_signal()"); \
return 0; \
} \
\
static inline int \
static inline int maybe_unused \
luaA_##prefix##_class_connect_signal(lua_State *L) \
{ \
luaA_class_connect_signal_from_stack(L, &(lua_class), \
luaL_checkstring(L, 1), 2); \
return 0; \
} \
\
static inline int \
static inline int maybe_unused \
luaA_##prefix##_class_disconnect_signal(lua_State *L) \
{ \
luaA_class_disconnect_signal_from_stack(L, &(lua_class), \
luaL_checkstring(L, 1), 2); \
return 0; \
} \
\
static inline int \
static inline int maybe_unused \
luaA_##prefix##_class_emit_signal(lua_State *L) \
{ \
luaA_class_emit_signal(L, &(lua_class), luaL_checkstring(L, 1), \
lua_gettop(L) - 1); \
return 0; \
} \
\
static inline int \
static inline int maybe_unused \
luaA_##prefix##_class_instances(lua_State *L) \
{ \
lua_pushinteger(L, (lua_class).instances); \
return 1; \
} \
\
static inline int \
static inline int maybe_unused \
luaA_##prefix##_set_index_miss_handler(lua_State *L) \
{ \
return luaA_registerfct(L, 1, &(lua_class).index_miss_handler); \
} \
\
static inline int \
static inline int maybe_unused \
luaA_##prefix##_set_newindex_miss_handler(lua_State *L) \
{ \
return luaA_registerfct(L, 1, &(lua_class).newindex_miss_handler); \
Expand Down
2 changes: 2 additions & 0 deletions common/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
#define unlikely(expr) expr
#endif

#define maybe_unused __attribute__ ((unused))

static inline void * __attribute__ ((malloc)) xmalloc(ssize_t size)
{
void *ptr;
Expand Down
Loading