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>
This commit is contained in:
Kieran Bingham 2021-11-23 17:23:07 +00:00
parent 2698597994
commit 7e125787ad
6 changed files with 7 additions and 27 deletions

View file

@ -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

View file

@ -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 <map>{% endif %}
{% if has_array %}#include <vector>{% 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__ */

View file

@ -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 <tuple>
#include <vector>
@ -43,5 +42,3 @@ public:
{% endfor %}
} /* namespace libcamera */
#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ */

View file

@ -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 <libcamera/ipa/core_ipa_interface.h>
#include <libcamera/ipa/ipa_interface.h>
@ -83,5 +82,3 @@ public:
{% endfor %}
{%- endif %}
} /* namespace libcamera */
#endif /* __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ */

View file

@ -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 <libcamera/ipa/ipa_interface.h>
#include <libcamera/ipa/{{module_name}}_ipa_interface.h>
@ -130,5 +129,3 @@ private:
{% endfor %}
{%- endif %}
} /* namespace libcamera */
#endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ */

View file

@ -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 <tuple>
#include <vector>
@ -44,5 +43,3 @@ public:
{% endfor %}
} /* namespace libcamera */
#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ */