Make the _hook_use aliases emit a deprecation warning

Turn `event_handler_hook_use` and `loop_hook_use` into real functions, so that
we can apply a `deprecated` attribute, which in turn will emit a compile-time
warning when either of these functions are used.

Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
pull/193/head
Gergely Nagy 7 years ago
parent 27caf6e958
commit 0fa9396ab2

@ -134,3 +134,13 @@ Kaleidoscope_::focusHook(const char *command) {
} }
Kaleidoscope_ Kaleidoscope; Kaleidoscope_ Kaleidoscope;
/* Deprecated functions */
void event_handler_hook_use(Kaleidoscope_::eventHandlerHook hook) {
Kaleidoscope.useEventHandlerHook(hook);
}
void loop_hook_use(Kaleidoscope_::loopHook hook) {
Kaleidoscope.useLoopHook(hook);
}

@ -121,5 +121,5 @@ extern Kaleidoscope_ Kaleidoscope;
/* -- DEPRECATED aliases; remove them when there are no more users. -- */ /* -- DEPRECATED aliases; remove them when there are no more users. -- */
#define event_handler_hook_use(hook) Kaleidoscope.useEventHandlerHook(hook); void event_handler_hook_use(Kaleidoscope_::eventHandlerHook hook) __attribute__((deprecated));
#define loop_hook_use(hook) Kaleidoscope.useLoopHook(hook) void loop_hook_use(Kaleidoscope_::loopHook hook) __attribute__((deprecated));

Loading…
Cancel
Save