From 8cda6915e64f4b6b2b5266fa1e3349cee0bff88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 14 Mar 2025 17:19:52 +0100 Subject: [PATCH] libcamera: controls: Generate macro for each control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate a macro in the form of LIBCAMERA_HAS_$VENDOR_VENDOR_$MODE_$NAME for each control so that its existence can be checked easily and without extra version checks. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- include/libcamera/control_ids.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in index 5d0594c6..6b571233 100644 --- a/include/libcamera/control_ids.h.in +++ b/include/libcamera/control_ids.h.in @@ -49,6 +49,7 @@ extern const std::array {{ctrl.n extern const std::map {{ctrl.name}}NameValueMap; {% endif -%} extern const Control<{{ctrl.type}}> {{ctrl.name}}; +#define LIBCAMERA_HAS_{{vendor|upper}}_VENDOR_{{mode|upper}}_{{ctrl.name|snake_case|upper}} {% endfor -%} {% if vendor != 'libcamera' %}