From db946364df42df861ddb96e5c6150894b05b5f52 Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sat, 29 Oct 2022 12:46:49 +0200 Subject: [PATCH] util: glsl2spirv.py: ensure '#endif' is printed in new line Fixes the following building errors: In file included from ../src/intel/vulkan/anv_pipeline_cache.c:34: src/intel/vulkan/float64_spv.h:3316:3: error: expected identifier or '(' };#endif // FLOAT64_SPV_H ^ src/intel/vulkan/float64_spv.h:1:2: error: unterminated conditional directive ^ ../src/intel/vulkan/anv_pipeline_cache.c:59:17: error: use of undeclared identifier 'anv_shader_bin_serialize'; did you mean 'anv_shader_bin_deserialize'? .serialize = anv_shader_bin_serialize, ^~~~~~~~~~~~~~~~~~~~~~~~ anv_shader_bin_deserialize ../src/intel/vulkan/anv_pipeline_cache.c:41:1: note: 'anv_shader_bin_deserialize' declared here anv_shader_bin_deserialize(struct vk_device *device, ^ ../src/intel/vulkan/anv_pipeline_cache.c:59:17: error: incompatible pointer types initializing 'bool (*)(struct vk_pipeline_cache_object *, struct blob *)' with an expression of type 'struct vk_pipeline_cache_object *(struct vk_device *, const void *, size_t, struct blob_reader *)' (aka 'struct vk_pipeline_cache_object *(struct vk_device *, const void *, unsigned long, struct blob_reader *)') [-Werror,-Wincompatible-pointer-types] .serialize = anv_shader_bin_serialize, ^~~~~~~~~~~~~~~~~~~~~~~~ 4 errors generated. Fixes: 9786d9e ("util: Add glsl2spirv.py script") Reviewed-by: Mykhailo Skorokhodov Part-of: --- src/util/glsl2spirv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/glsl2spirv.py b/src/util/glsl2spirv.py index 02aba4474fe..f11bf612cb1 100644 --- a/src/util/glsl2spirv.py +++ b/src/util/glsl2spirv.py @@ -69,7 +69,7 @@ def create_include_guard(lines, filename): guard_head = ["#ifndef {}\n".format(upper_name), "#define {}\n".format(upper_name)] - guard_tail = ["#endif // {}\n".format(upper_name)] + guard_tail = ["\n#endif // {}\n".format(upper_name)] # remove '#pragma once' for idx, l in enumerate(lines):