Update a comment to reflect reality

The `INSTANTIATE_WEAK_HOOK_FUNCTION` claimed that it's there for v1 API
compatibility alone - it is not. It allows us to have sketches that use no
plugins too, without them having to use `KALEIDOSCOPE_INIT_PLUGINS()` with a
dummy plugin.

We'd need a dummy plugin because `KALEIDOSCOPE_INIT_PLUGINS()` does not support
being invoked with an empty plugin list, due to technical reasons. From an
end-user point of view, not using the macro is much preferable to using it with
a dummy plugin. We can't automatically inject a dummy plugin either, again, due
to technical reasons.

Fixes #1005.

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/1014/head v1.99.3
Gergely Nagy 4 years ago committed by Jesse Vincent
parent b3b56efdf8
commit c924fb0dc6
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -21,15 +21,14 @@
namespace kaleidoscope { namespace kaleidoscope {
// The following weak symbols are overwritten by // The following weak symbols are overwritten by using the
// using the KALEIDOSCOPE_INIT_PLUGINS(...) macro // KALEIDOSCOPE_INIT_PLUGINS(...) macro in the firmware sketch. Their only
// in the the firmware sketch. Their only purpose is // purpose is to ensure that there are no undefined symbols if
// to provide backwards compatibility during the transition // KALEIDOSCOPE_INIT_PLUGINS(...) is not used. Sketches that use no plugins do
// from the old implementation of the hooking/plugin system // not use the macro, because due to technical reasons, we do not support an
// to the new one. The weak symbols ensure that there // empty KALEIDOSCOPE_INIT_PLUGINS() invocation. These symbols therefore ensure
// are no undefined symbols if KALEIDOSCOPE_INIT_PLUGINS(...) // that we can compile sketches that use no plugins, without them having to use
// is not used. This allows legacy sketches to be used // KALEIDOSCOPE_INIT_PLUGINS() with a dummy plugin.
// during the transition phase.
#define INSTANTIATE_WEAK_HOOK_FUNCTION( \ #define INSTANTIATE_WEAK_HOOK_FUNCTION( \
HOOK_NAME, HOOK_VERSION, DEPRECATION_TAG, \ HOOK_NAME, HOOK_VERSION, DEPRECATION_TAG, \

Loading…
Cancel
Save