Skip to content
Snippets Groups Projects
Commit ae57b6ca authored by James R.'s avatar James R.
Browse files

MORE MACROS

I just can't stop myself!
parent 33132930
No related branches found
No related tags found
No related merge requests found
......@@ -90,9 +90,13 @@ grepped and found in the lists above.
#define HOOK(name) hook_ ## name
#define STRING_HOOK(name) stringhook_ ## name
enum { MOBJ_HOOK_LIST (MOBJ_HOOK) MOBJ_HOOK(MAX) };
enum { HOOK_LIST (HOOK) HOOK(MAX) };
enum { STRING_HOOK_LIST (STRING_HOOK) STRING_HOOK(MAX) };
#define ENUM(X) enum { X ## _LIST (X) X(MAX) }
ENUM (MOBJ_HOOK);
ENUM (HOOK);
ENUM (STRING_HOOK);
#undef ENUM
/* dead simple, LUA_HOOK(GameQuit) */
#define LUA_HOOK(type) LUA_HookVoid(HOOK(type))
......
......@@ -31,12 +31,14 @@
ABSTRACTION
========================================================================= */
static const char * const mobjHookNames[] = { MOBJ_HOOK_LIST (TOSTR) NULL };
static const char * const hookNames[] = { HOOK_LIST (TOSTR) NULL };
#define LIST(id, M) \
static const char * const id [] = { M (TOSTR) NULL }
static const char * const stringHookNames[] = {
STRING_HOOK_LIST (TOSTR) NULL
};
LIST (mobjHookNames, MOBJ_HOOK_LIST);
LIST (hookNames, HOOK_LIST);
LIST (stringHookNames, STRING_HOOK_LIST);
#undef LIST
typedef struct {
int numHooks;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment