From: Carl Worth Date: Mon, 17 May 2010 17:34:29 +0000 (-0700) Subject: Fix bug (and add test) for a function-like-macro appearing as a non-macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=acf87bc03411c4d9b818a346bc9dad858b0a2407;p=mesa.git Fix bug (and add test) for a function-like-macro appearing as a non-macro. That is, when a function-like macro appears in the content without parentheses it should be accepted and passed on through, (previously the parser was regarding this as a syntax error). --- diff --git a/glcpp-parse.y b/glcpp-parse.y index 16d2a28a007..6f158d91398 100644 --- a/glcpp-parse.y +++ b/glcpp-parse.y @@ -133,6 +133,10 @@ content: printf ("%s", $1); talloc_free ($1); } +| FUNC_MACRO { + printf ("%s", $1); + talloc_free ($1); + } | macro { _print_string_list ($1); } diff --git a/tests/025-func-macro-as-non-macro.c b/tests/025-func-macro-as-non-macro.c new file mode 100644 index 00000000000..3dbe026d9dd --- /dev/null +++ b/tests/025-func-macro-as-non-macro.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo