From patchwork Tue Nov 23 22:40:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14745 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4E8EDBF415 for ; Tue, 23 Nov 2021 22:40:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EF34860441; Tue, 23 Nov 2021 23:40:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CaQXkDCY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB1DE6042B for ; Tue, 23 Nov 2021 23:40:23 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 96F24F95; Tue, 23 Nov 2021 23:40:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707223; bh=NZeS09z7rFlurG5pa7zDfpw/1BwH2lWZtakDmVEQkvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaQXkDCY6pnMZKFGDTIeIkRMDNAD/jXgcHczKsiR00Io8tHo7T26Iyx8T66UVGstu l/+BZovziS/YXcxGHd+akUW/ds9LKVZ1QIjBwJOJI5BqICImK+gyumwDV1d6wrUlEp NFeD5YfkGdhUyPGqdwWF6hbDcZppAqXCkWiX6pGw= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:14 +0000 Message-Id: <20211123224015.3619282-15-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 14/15] utils: Convert to pragma once X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- utils/gen-header.sh | 9 ++------- .../libcamera_templates/core_ipa_interface.h.tmpl | 5 +---- .../libcamera_templates/core_ipa_serializer.h.tmpl | 5 +---- .../libcamera_templates/module_ipa_interface.h.tmpl | 5 +---- .../libcamera_templates/module_ipa_proxy.h.tmpl | 5 +---- .../libcamera_templates/module_ipa_serializer.h.tmpl | 5 +---- 6 files changed, 7 insertions(+), 27 deletions(-) diff --git a/utils/gen-header.sh b/utils/gen-header.sh index fcb9c5e16d07..8b66c5dd0f47 100755 --- a/utils/gen-header.sh +++ b/utils/gen-header.sh @@ -11,8 +11,8 @@ cat < "$dst_file" * * libcamera.h - libcamera public API */ -#ifndef __LIBCAMERA_LIBCAMERA_H__ -#define __LIBCAMERA_LIBCAMERA_H__ + +#pragma once EOF @@ -25,8 +25,3 @@ done | sort) for header in $headers ; do echo "#include " >> "$dst_file" done - -cat <> "$dst_file" - -#endif /* __LIBCAMERA_LIBCAMERA_H__ */ -EOF diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl index 6bf6094b9456..a565b59ada25 100644 --- a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl @@ -12,8 +12,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ -#define __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ +#pragma once {% if has_map %}#include {% endif %} {% if has_array %}#include {% endif %} @@ -36,5 +35,3 @@ static const {{const.kind|name}} {{const.mojom_name}} = {{const.value}}; {% endfor %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl index 37a784f1f940..5738a1aa3405 100644 --- a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl @@ -13,8 +13,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ -#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ +#pragma once #include #include @@ -43,5 +42,3 @@ public: {% endfor %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl index ebe811fa1028..415ec283895c 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl @@ -12,8 +12,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ -#define __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ +#pragma once #include #include @@ -83,5 +82,3 @@ public: {% endfor %} {%- endif %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl index 1979e68ff74d..ce396c183d0c 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl @@ -13,8 +13,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ -#define __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ +#pragma once #include #include @@ -130,5 +129,3 @@ private: {% endfor %} {%- endif %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl index 779d2114f9f3..8b709705aa32 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl @@ -13,8 +13,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ -#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ +#pragma once #include #include @@ -44,5 +43,3 @@ public: {% endfor %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ */