[Mesa-dev] [PATCH 03/10] nir: error when directly including nir_opcodes.h

Emil Velikov emil.l.velikov at gmail.com
Wed Oct 7 03:11:30 PDT 2015


The file is meant to be included via nir.h.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/glsl/nir/nir_opcodes_h.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/glsl/nir/nir_opcodes_h.py b/src/glsl/nir/nir_opcodes_h.py
index be15a96..444bee0 100644
--- a/src/glsl/nir/nir_opcodes_h.py
+++ b/src/glsl/nir/nir_opcodes_h.py
@@ -29,6 +29,10 @@ template = """\
 #ifndef _NIR_OPCODES_
 #define _NIR_OPCODES_
 
+#ifndef NIR_H
+#error "Must not be included directly. Include nir.h instead"
+#endif /* NIR_H */
+
 <% opcode_names = sorted(opcodes.iterkeys()) %>
 
 typedef enum {
-- 
2.5.0



More information about the mesa-dev mailing list