summaryrefslogtreecommitdiff
path: root/utils/gen-header.sh
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-11-23 17:23:07 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-11-24 12:19:03 +0000
commit7e125787add066625bb2a3f8eed8234bc4f8cc11 (patch)
treeb2d6b45cde44f7eeb7b953c3012ae4451e23e999 /utils/gen-header.sh
parent269859799481acec13e35bb6fb97458756e4991a (diff)
utils: Convert to pragma once
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 <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Diffstat (limited to 'utils/gen-header.sh')
-rwxr-xr-xutils/gen-header.sh9
1 files changed, 2 insertions, 7 deletions
diff --git a/utils/gen-header.sh b/utils/gen-header.sh
index fcb9c5e1..8b66c5dd 100755
--- a/utils/gen-header.sh
+++ b/utils/gen-header.sh
@@ -11,8 +11,8 @@ cat <<EOF > "$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 <libcamera/$header>" >> "$dst_file"
done
-
-cat <<EOF >> "$dst_file"
-
-#endif /* __LIBCAMERA_LIBCAMERA_H__ */
-EOF