@@ -168,18 +168,19 @@ bool glslang_read_shader_file(const char *path,
168168
169169 /* Allows us to use #line to make dealing with shader
170170 * errors easier. */
171- if (!string_list_append (output ,
171+ if (!string_list_append_n (output ,
172172 "#extension GL_GOOGLE_cpp_style_line_directive : require" ,
173+ STRLEN_CONST ("#extension GL_GOOGLE_cpp_style_line_directive : require" ),
173174 attr ))
174175 {
175176 * newline = saved ;
176177 goto cleanup ;
177178 }
178179
179180 /* Append feature defines */
180- if (!string_list_append (output , "#define _HAS_ORIGINALASPECT_UNIFORMS" , attr )
181- || !string_list_append (output , "#define _HAS_FRAMETIME_UNIFORMS" , attr )
182- || !string_list_append (output , "#define _HAS_SENSOR_UNIFORMS" , attr ))
181+ if (!string_list_append_n (output , "#define _HAS_ORIGINALASPECT_UNIFORMS" , STRLEN_CONST ( "#define _HAS_ORIGINALASPECT_UNIFORMS" ) , attr )
182+ || !string_list_append_n (output , "#define _HAS_FRAMETIME_UNIFORMS" , STRLEN_CONST ( "#define _HAS_FRAMETIME_UNIFORMS" ) , attr )
183+ || !string_list_append_n (output , "#define _HAS_SENSOR_UNIFORMS" , STRLEN_CONST ( "#define _HAS_SENSOR_UNIFORMS" ) , attr ))
183184 {
184185 * newline = saved ;
185186 goto cleanup ;
@@ -202,9 +203,9 @@ bool glslang_read_shader_file(const char *path,
202203 /* Non-root or non-slang: emit feature defines + #line once */
203204 if (root_file )
204205 {
205- if (!string_list_append (output , "#define _HAS_ORIGINALASPECT_UNIFORMS" , attr )
206- || !string_list_append (output , "#define _HAS_FRAMETIME_UNIFORMS" , attr )
207- || !string_list_append (output , "#define _HAS_SENSOR_UNIFORMS" , attr ))
206+ if (!string_list_append_n (output , "#define _HAS_ORIGINALASPECT_UNIFORMS" , STRLEN_CONST ( "#define _HAS_ORIGINALASPECT_UNIFORMS" ) , attr )
207+ || !string_list_append_n (output , "#define _HAS_FRAMETIME_UNIFORMS" , STRLEN_CONST ( "#define _HAS_FRAMETIME_UNIFORMS" ) , attr )
208+ || !string_list_append_n (output , "#define _HAS_SENSOR_UNIFORMS" , STRLEN_CONST ( "#define _HAS_SENSOR_UNIFORMS" ) , attr ))
208209 {
209210 * newline = saved ;
210211 goto cleanup ;
@@ -219,9 +220,9 @@ bool glslang_read_shader_file(const char *path,
219220 }
220221 else
221222 {
222- if (!string_list_append (output , "#define _HAS_ORIGINALASPECT_UNIFORMS" , attr )
223- || !string_list_append (output , "#define _HAS_FRAMETIME_UNIFORMS" , attr )
224- || !string_list_append (output , "#define _HAS_SENSOR_UNIFORMS" , attr ))
223+ if (!string_list_append_n (output , "#define _HAS_ORIGINALASPECT_UNIFORMS" , STRLEN_CONST ( "#define _HAS_ORIGINALASPECT_UNIFORMS" ) , attr )
224+ || !string_list_append_n (output , "#define _HAS_FRAMETIME_UNIFORMS" , STRLEN_CONST ( "#define _HAS_FRAMETIME_UNIFORMS" ) , attr )
225+ || !string_list_append_n (output , "#define _HAS_SENSOR_UNIFORMS" , STRLEN_CONST ( "#define _HAS_SENSOR_UNIFORMS" ) , attr ))
225226 {
226227 * newline = saved ;
227228 goto cleanup ;
0 commit comments