Mesa (master): nir: consistently use ifndef guards over pragma once

Emil Velikov evelikov at kemper.freedesktop.org
Wed Mar 22 16:59:31 UTC 2017


Module: Mesa
Branch: master
Commit: e3de145fa26dadf43f6e14ed69aace6a550cd157
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3de145fa26dadf43f6e14ed69aace6a550cd157

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Mon Mar 20 16:04:16 2017 +0000

nir: 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/compiler/nir/nir.h                      | 5 ++++-
 src/compiler/nir/nir_array.h                | 5 ++++-
 src/compiler/nir/nir_constant_expressions.h | 5 +++++
 src/compiler/nir/nir_control_flow.h         | 7 +++++--
 src/compiler/nir/nir_control_flow_private.h | 6 +++++-
 src/compiler/nir/nir_instr_set.h            | 4 +++-
 src/compiler/nir/nir_loop_analyze.h         | 5 ++++-
 src/compiler/nir/nir_phi_builder.h          | 5 ++++-
 src/compiler/nir/nir_vla.h                  | 6 ++++--
 src/compiler/nir/nir_worklist.h             | 1 -
 10 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 57b8be3dde..405e673943 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -25,7 +25,8 @@
  *
  */
 
-#pragma once
+#ifndef NIR_H
+#define NIR_H
 
 #include "util/hash_table.h"
 #include "compiler/glsl/list.h"
@@ -2634,3 +2635,5 @@ gl_system_value nir_system_value_from_intrinsic(nir_intrinsic_op intrin);
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
+
+#endif /* NIR_H */
diff --git a/src/compiler/nir/nir_array.h b/src/compiler/nir/nir_array.h
index 1db4e8cea3..4d7a532a7f 100644
--- a/src/compiler/nir/nir_array.h
+++ b/src/compiler/nir/nir_array.h
@@ -25,7 +25,8 @@
  *
  */
 
-#pragma once
+#ifndef NIR_ARRAY_H
+#define NIR_ARRAY_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -94,3 +95,5 @@ nir_array_grow(nir_array *arr, size_t additional)
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
+
+#endif /* NIR_ARRAY_H */
diff --git a/src/compiler/nir/nir_constant_expressions.h b/src/compiler/nir/nir_constant_expressions.h
index 201f278c71..1d6bbbc25d 100644
--- a/src/compiler/nir/nir_constant_expressions.h
+++ b/src/compiler/nir/nir_constant_expressions.h
@@ -25,7 +25,12 @@
  *
  */
 
+#ifndef NIR_CONSTANT_EXPRESSIONS_H
+#define NIR_CONSTANT_EXPRESSIONS_H
+
 #include "nir.h"
 
 nir_const_value nir_eval_const_opcode(nir_op op, unsigned num_components,
                                       unsigned bit_size, nir_const_value *src);
+
+#endif /* NIR_CONSTANT_EXPRESSIONS_H */
diff --git a/src/compiler/nir/nir_control_flow.h b/src/compiler/nir/nir_control_flow.h
index b496aec035..a487eb0466 100644
--- a/src/compiler/nir/nir_control_flow.h
+++ b/src/compiler/nir/nir_control_flow.h
@@ -25,9 +25,10 @@
  *
  */
 
-#include "nir.h"
+#ifndef NIR_CONTROL_FLOW_H
+#define NIR_CONTROL_FLOW_H
 
-#pragma once
+#include "nir.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -163,3 +164,5 @@ nir_cf_node_remove(nir_cf_node *node)
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* NIR_CONTROL_FLOW_H */
diff --git a/src/compiler/nir/nir_control_flow_private.h b/src/compiler/nir/nir_control_flow_private.h
index f32b57a8ce..31e6d3c0e9 100644
--- a/src/compiler/nir/nir_control_flow_private.h
+++ b/src/compiler/nir/nir_control_flow_private.h
@@ -25,9 +25,11 @@
  *
  */
 
+#ifndef NIR_CONTROL_FLOW_PRIVATE_H
+#define NIR_CONTROL_FLOW_PRIVATE_H
+
 #include "nir_control_flow.h"
 
-#pragma once
 
 /* Internal control-flow modification functions used when inserting/removing
  * instructions.
@@ -35,3 +37,5 @@
 
 void nir_handle_add_jump(nir_block *block);
 void nir_handle_remove_jump(nir_block *block, nir_jump_type type);
+
+#endif /* NIR_CONTROL_FLOW_PRIVATE_H */
diff --git a/src/compiler/nir/nir_instr_set.h b/src/compiler/nir/nir_instr_set.h
index 939e8ddbf5..26817f62e9 100644
--- a/src/compiler/nir/nir_instr_set.h
+++ b/src/compiler/nir/nir_instr_set.h
@@ -21,7 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#pragma once
+#ifndef NIR_INSTR_SET_H
+#define NIR_INSTR_SET_H
 
 #include "nir.h"
 
@@ -60,3 +61,4 @@ void nir_instr_set_remove(struct set *instr_set, nir_instr *instr);
 
 /*@}*/
 
+#endif /* NIR_INSTR_SET_H */
diff --git a/src/compiler/nir/nir_loop_analyze.h b/src/compiler/nir/nir_loop_analyze.h
index b7f862e8c0..18c2305171 100644
--- a/src/compiler/nir/nir_loop_analyze.h
+++ b/src/compiler/nir/nir_loop_analyze.h
@@ -21,7 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#pragma once
+#ifndef NIR_LOOP_ANALYZE_H
+#define NIR_LOOP_ANALYZE_H
 
 #include "nir.h"
 
@@ -90,3 +91,5 @@ nir_is_trivial_loop_if(nir_if *nif, nir_block *break_block)
 
    return true;
 }
+
+#endif /* NIR_LOOP_ANALYZE_H */
diff --git a/src/compiler/nir/nir_phi_builder.h b/src/compiler/nir/nir_phi_builder.h
index a4dc18a2b2..c663d04183 100644
--- a/src/compiler/nir/nir_phi_builder.h
+++ b/src/compiler/nir/nir_phi_builder.h
@@ -21,7 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#pragma once
+#ifndef NIR_PHI_BUILDER_H
+#define NIR_PHI_BUILDER_H
 
 #include "nir.h"
 
@@ -114,3 +115,5 @@ nir_phi_builder_value_get_block_def(struct nir_phi_builder_value *val,
  * adds the phi nodes to the program.
  */
 void nir_phi_builder_finish(struct nir_phi_builder *pb);
+
+#endif /* NIR_PHI_BUILDER_H */
diff --git a/src/compiler/nir/nir_vla.h b/src/compiler/nir/nir_vla.h
index 753783316a..d01c039cfd 100644
--- a/src/compiler/nir/nir_vla.h
+++ b/src/compiler/nir/nir_vla.h
@@ -25,8 +25,8 @@
  *
  **************************************************************************/
 
-#pragma once
-
+#ifndef NIR_VLA_H
+#define NIR_VLA_H
 
 #include "c99_alloca.h"
 
@@ -52,3 +52,5 @@
  */
 #define NIR_VLA_ZERO(_type, _name, _length) \
    NIR_VLA_FILL(_type, _name, _length, 0)
+
+#endif /* NIR_VLA_H */
diff --git a/src/compiler/nir/nir_worklist.h b/src/compiler/nir/nir_worklist.h
index 829bff24a5..39521a386c 100644
--- a/src/compiler/nir/nir_worklist.h
+++ b/src/compiler/nir/nir_worklist.h
@@ -25,7 +25,6 @@
  *
  */
 
-#pragma once
 
 #ifndef _NIR_WORKLIST_
 #define _NIR_WORKLIST_




More information about the mesa-commit mailing list