Mesa (master): util: consistently use ifndef guards over pragma once
Emil Velikov
evelikov at kemper.freedesktop.org
Wed Mar 22 16:59:32 UTC 2017
Module: Mesa
Branch: master
Commit: d542d2fc13fd67a444c202b706fa44a34cc53c90
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d542d2fc13fd67a444c202b706fa44a34cc53c90
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date: Mon Mar 20 16:04:40 2017 +0000
util: consistently use ifndef guards over pragma once
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Acked-by: Vedran Miletić <vedran at miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
---
src/util/build_id.h | 5 +++++
src/util/format_r11g11b10f.h | 5 +++++
src/util/register_allocate.h | 6 +++++-
src/util/strndup.h | 5 ++++-
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/util/build_id.h b/src/util/build_id.h
index 551ac6989b..18641c44af 100644
--- a/src/util/build_id.h
+++ b/src/util/build_id.h
@@ -21,6 +21,9 @@
* IN THE SOFTWARE.
*/
+#ifndef BUILD_ID_H
+#define BUILD_ID_H
+
#ifdef HAVE_DL_ITERATE_PHDR
struct build_id_note;
@@ -35,3 +38,5 @@ const uint8_t *
build_id_data(const struct build_id_note *note);
#endif
+
+#endif /* BUILD_ID_H */
diff --git a/src/util/format_r11g11b10f.h b/src/util/format_r11g11b10f.h
index f6cd4ac696..ec5abf9611 100644
--- a/src/util/format_r11g11b10f.h
+++ b/src/util/format_r11g11b10f.h
@@ -27,6 +27,9 @@
* below.
*/
+#ifndef FORMAT_R11G11B10F_H
+#define FORMAT_R11G11B10F_H
+
#include <stdint.h>
#define UF11(e, m) ((e << 6) | (m))
@@ -225,3 +228,5 @@ static inline void r11g11b10f_to_float3(uint32_t rgb, float retval[3])
retval[1] = uf11_to_f32((rgb >> 11) & 0x7ff);
retval[2] = uf10_to_f32((rgb >> 22) & 0x3ff);
}
+
+#endif /* FORMAT_R11G11B10F_H */
diff --git a/src/util/register_allocate.h b/src/util/register_allocate.h
index 628d2bbbce..6abb4e04d0 100644
--- a/src/util/register_allocate.h
+++ b/src/util/register_allocate.h
@@ -25,8 +25,10 @@
*
*/
-#include <stdbool.h>
+#ifndef REGISTER_ALLOCATE_H
+#define REGISTER_ALLOCATE_H
+#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
@@ -89,3 +91,5 @@ int ra_get_best_spill_node(struct ra_graph *g);
#ifdef __cplusplus
} // extern "C"
#endif
+
+#endif /* REGISTER_ALLOCATE_H */
diff --git a/src/util/strndup.h b/src/util/strndup.h
index c5ed7a8c8d..a3d7398413 100644
--- a/src/util/strndup.h
+++ b/src/util/strndup.h
@@ -21,7 +21,8 @@
* IN THE SOFTWARE.
*/
-#pragma once
+#ifndef STRNDUP_H
+#define STRNDUP_H
#include <stdlib.h> // size_t
@@ -38,3 +39,5 @@ char *strndup(const char *str, size_t max);
#endif
#endif
+
+#endif /* STRNDUP_H */
More information about the mesa-commit
mailing list