compiler: Generate files with newline at end
These generator scripts use the `write` function that, unlike `print`,
doesn't print a trailing newline. So let's add one to the template.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35697>
diff --git a/src/compiler/builtin_types_h.py b/src/compiler/builtin_types_h.py
index afffff8..bc95283 100644
--- a/src/compiler/builtin_types_h.py
+++ b/src/compiler/builtin_types_h.py
@@ -21,7 +21,8 @@
extern const struct glsl_type glsl_type_builtin_${t["name"]};
%endfor
-#endif /* _BUILTIN_TYPES_ */"""
+#endif /* _BUILTIN_TYPES_ */
+"""
if len(sys.argv) < 2:
print('Missing output argument', file=sys.stderr)
diff --git a/src/compiler/nir/nir_intrinsics_h.py b/src/compiler/nir/nir_intrinsics_h.py
index 1a2350b..64e7425 100644
--- a/src/compiler/nir/nir_intrinsics_h.py
+++ b/src/compiler/nir/nir_intrinsics_h.py
@@ -45,7 +45,8 @@
extern const char *nir_intrinsic_index_names[NIR_INTRINSIC_NUM_INDEX_FLAGS];
-#endif /* _NIR_INTRINSICS_ */"""
+#endif /* _NIR_INTRINSICS_ */
+"""
from nir_intrinsics import INTR_OPCODES, INTR_INDICES
from mako.template import Template
diff --git a/src/compiler/nir/nir_intrinsics_indices_h.py b/src/compiler/nir/nir_intrinsics_indices_h.py
index 9d5dbb3..9f20814 100644
--- a/src/compiler/nir/nir_intrinsics_indices_h.py
+++ b/src/compiler/nir/nir_intrinsics_indices_h.py
@@ -69,7 +69,8 @@
}
% endfor
-#endif /* _NIR_INTRINSICS_INDICES_ */"""
+#endif /* _NIR_INTRINSICS_INDICES_ */
+"""
from nir_intrinsics import INTR_INDICES
from mako.template import Template