glsl/glcpp: Emit error for duplicate parameter name in function-like macro

This will emit an error for something like:

	#define FOO(x,x) ...

Obviously, it's not a legal thing to do, and it's easy to check.

Add a "make check" test for this as well.

This fixes the following Khronos GLES3 CTS tests:

	invalid_function_definitions.unique_param_name_vertex
	invalid_function_definitions.unique_param_name_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Carl Worth
2014-06-25 13:41:47 -07:00
parent fe1e0ac852
commit 34cd293c8a
3 changed files with 35 additions and 0 deletions
@@ -0,0 +1,2 @@
#define FOO(a,a) which a?
#define BAR(x,y,z,x) so very x
@@ -0,0 +1,4 @@
0:1(9): preprocessor error: Duplicate macro parameter "a"
0:2(9): preprocessor error: Duplicate macro parameter "x"