From c96b8302a398a6db27f1bb6070cdc088c7ee0fba Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 8 Jun 2012 15:00:49 -0700 Subject: glsl: glcpp: Allow "#if undefined-macro' to evaluate to false. A strict reading of the GLSL specification would have this be an error, but we've received reports from users who expect the preprocessor to interepret undefined macros as 0. This is the standard behavior of the rpeprocessor for C, and according to these user reports is also the behavior of other OpenGL implementations. So here's one of those cases where we can make our users happier by ignoring the specification. And it's hard to imagine users who really, really want to see an error for this case. The two affected tests cases are updated to reflect the new behavior. Signed-off-by: Carl Worth Reviewed-by: Kenneth Graunke --- src/glsl/glcpp/tests/070-undefined-macro-in-expression.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glsl/glcpp/tests/070-undefined-macro-in-expression.c') diff --git a/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c b/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c index b6dc2ba075f..d15a4840b01 100644 --- a/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c +++ b/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c @@ -1,2 +1,5 @@ #if UNDEFINED_MACRO +Failure +#else +Success #endif -- cgit v1.2.3