From d40a598970b04bfe3a867a5e12debc45c149b46b Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 14 Mar 2023 12:19:48 +0000 Subject: plugins: Simplify plugin/codec API versioning Replace the minimum version bound with a check on the size of the API struct. The version only needs to be incremented for ABI breaking changes. Additions to the API won't need to touch the version number, resulting in fewer merge conflicts. Change-Id: I916a04a7bf5890dcf5d615ce30087643165f8e1f --- apps/plugins/lib/overlay.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apps/plugins/lib/overlay.c') diff --git a/apps/plugins/lib/overlay.c b/apps/plugins/lib/overlay.c index 0ecc1bf3e7..065273534e 100644 --- a/apps/plugins/lib/overlay.c +++ b/apps/plugins/lib/overlay.c @@ -83,9 +83,8 @@ enum plugin_status run_overlay(const void* parameter, goto error_close; } - - if (hdr->api_version > PLUGIN_API_VERSION - || hdr->api_version < PLUGIN_MIN_API_VERSION) + if (hdr->api_version != PLUGIN_API_VERSION || + p_hdr->api_size > sizeof(struct plugin_api)) { rb->splashf(2*HZ, "%s overlay: Incompatible version.", name); goto error_close; -- cgit v1.2.3