{"id":14745,"url":"https://patchwork.libcamera.org/api/1.1/patches/14745/?format=json","web_url":"https://patchwork.libcamera.org/patch/14745/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211123224015.3619282-15-kieran.bingham@ideasonboard.com>","date":"2021-11-23T22:40:14","name":"[libcamera-devel,14/15] utils: Convert to pragma once","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"564afaeade591e153d49ac305d31f6a225f79006","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":{"id":11,"url":"https://patchwork.libcamera.org/api/1.1/users/11/?format=json","username":"kbingham","first_name":"Kieran","last_name":"Bingham","email":"kieran.bingham@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/14745/mbox/","series":[{"id":2749,"url":"https://patchwork.libcamera.org/api/1.1/series/2749/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2749","date":"2021-11-23T22:40:00","name":"Use pragma once","version":1,"mbox":"https://patchwork.libcamera.org/series/2749/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14745/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14745/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4E8EDBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Nov 2021 22:40:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EF34860441;\n\tTue, 23 Nov 2021 23:40:40 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB1DE6042B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Nov 2021 23:40:23 +0100 (CET)","from Monstersaurus.ksquared.org.uk.beta.tailscale.net\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 96F24F95;\n\tTue, 23 Nov 2021 23:40:23 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CaQXkDCY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637707223;\n\tbh=NZeS09z7rFlurG5pa7zDfpw/1BwH2lWZtakDmVEQkvk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=CaQXkDCY6pnMZKFGDTIeIkRMDNAD/jXgcHczKsiR00Io8tHo7T26Iyx8T66UVGstu\n\tl/+BZovziS/YXcxGHd+akUW/ds9LKVZ1QIjBwJOJI5BqICImK+gyumwDV1d6wrUlEp\n\tNFeD5YfkGdhUyPGqdwWF6hbDcZppAqXCkWiX6pGw=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","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","Content-Transfer-Encoding":"8bit","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":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Remove the verbose #ifndef/#define/#endif pattern for maintaining\nheader idempotency, and replace it with a simple #pragma once.\n\nThis simplifies the headers, and prevents redundant changes when\nheader files get moved.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n utils/gen-header.sh                                      | 9 ++-------\n .../libcamera_templates/core_ipa_interface.h.tmpl        | 5 +----\n .../libcamera_templates/core_ipa_serializer.h.tmpl       | 5 +----\n .../libcamera_templates/module_ipa_interface.h.tmpl      | 5 +----\n .../libcamera_templates/module_ipa_proxy.h.tmpl          | 5 +----\n .../libcamera_templates/module_ipa_serializer.h.tmpl     | 5 +----\n 6 files changed, 7 insertions(+), 27 deletions(-)","diff":"diff --git a/utils/gen-header.sh b/utils/gen-header.sh\nindex fcb9c5e16d07..8b66c5dd0f47 100755\n--- a/utils/gen-header.sh\n+++ b/utils/gen-header.sh\n@@ -11,8 +11,8 @@ cat <<EOF > \"$dst_file\"\n  *\n  * libcamera.h - libcamera public API\n  */\n-#ifndef __LIBCAMERA_LIBCAMERA_H__\n-#define __LIBCAMERA_LIBCAMERA_H__\n+\n+#pragma once\n \n EOF\n \n@@ -25,8 +25,3 @@ done | sort)\n for header in $headers ; do\n \techo \"#include <libcamera/$header>\" >> \"$dst_file\"\n done\n-\n-cat <<EOF >> \"$dst_file\"\n-\n-#endif /* __LIBCAMERA_LIBCAMERA_H__ */\n-EOF\ndiff --git a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\nindex 6bf6094b9456..a565b59ada25 100644\n--- a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n+++ b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n@@ -12,8 +12,7 @@\n  * This file is auto-generated. Do not edit.\n  */\n \n-#ifndef __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__\n-#define __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__\n+#pragma once\n \n {% if has_map %}#include <map>{% endif %}\n {% if has_array %}#include <vector>{% endif %}\n@@ -36,5 +35,3 @@ static const {{const.kind|name}} {{const.mojom_name}} = {{const.value}};\n {% endfor %}\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ */\ndiff --git a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl\nindex 37a784f1f940..5738a1aa3405 100644\n--- a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl\n+++ b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl\n@@ -13,8 +13,7 @@\n  * This file is auto-generated. Do not edit.\n  */\n \n-#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__\n-#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__\n+#pragma once\n \n #include <tuple>\n #include <vector>\n@@ -43,5 +42,3 @@ public:\n {% endfor %}\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ */\ndiff --git a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\nindex ebe811fa1028..415ec283895c 100644\n--- a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n+++ b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n@@ -12,8 +12,7 @@\n  * This file is auto-generated. Do not edit.\n  */\n \n-#ifndef __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__\n-#define __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__\n+#pragma once\n \n #include <libcamera/ipa/core_ipa_interface.h>\n #include <libcamera/ipa/ipa_interface.h>\n@@ -83,5 +82,3 @@ public:\n {% endfor %}\n {%- endif %}\n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ */\ndiff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl\nindex 1979e68ff74d..ce396c183d0c 100644\n--- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl\n+++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl\n@@ -13,8 +13,7 @@\n  * This file is auto-generated. Do not edit.\n  */\n \n-#ifndef __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__\n-#define __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__\n+#pragma once\n \n #include <libcamera/ipa/ipa_interface.h>\n #include <libcamera/ipa/{{module_name}}_ipa_interface.h>\n@@ -130,5 +129,3 @@ private:\n {% endfor %}\n {%- endif %}\n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ */\ndiff --git a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl\nindex 779d2114f9f3..8b709705aa32 100644\n--- a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl\n+++ b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl\n@@ -13,8 +13,7 @@\n  * This file is auto-generated. Do not edit.\n  */\n \n-#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__\n-#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__\n+#pragma once\n \n #include <tuple>\n #include <vector>\n@@ -44,5 +43,3 @@ public:\n {% endfor %}\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ */\n","prefixes":["libcamera-devel","14/15"]}