From a6c66b64d8079040294bf7afbabcdbf536466c9d Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 6 Jun 2017 13:15:58 +0200 Subject: [PATCH] Add an USE_PLUGIN() macro Does the same thing as `Kaleidoscope.use` (and `USE_PLUGINS` as a consequence), but for only one plugin. While it is a bit more of a burden to call `USE_PLUGIN` for all plugins, than it is to list them in `USE_PLUGINS`. The advantage is that the result is noticeably smaller code. Having both allows the end-user to choose convenience or small size, depending on their needs. Signed-off-by: Gergely Nagy --- src/Kaleidoscope.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Kaleidoscope.h b/src/Kaleidoscope.h index 7488ed5e..896816fc 100644 --- a/src/Kaleidoscope.h +++ b/src/Kaleidoscope.h @@ -50,6 +50,7 @@ extern HARDWARE_IMPLEMENTATION KeyboardHardware; static KaleidoscopePlugin *__p[] = {plugins, NULL}; \ Kaleidoscope.use(plugins, NULL); \ }) +#define USE_PLUGIN(plugin) (plugin)->begin() class KaleidoscopePlugin { public: