From e3678b6d4b60aabf57b2157260867896847b60ca Mon Sep 17 00:00:00 2001 From: lazaray <104470294+lazaray@users.noreply.github.com> Date: Tue, 3 May 2022 15:00:16 +0200 Subject: [PATCH] Fix parser detection of macros including spaces --- parser/raylib_parser.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 0b94fcefa..9915c3b25 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -577,7 +577,14 @@ int main(int argc, char* argv[]) // Extract name int defineNameStart = j; - while ((linePtr[j] != ' ') && (linePtr[j] != '\t') && (linePtr[j] != '\0')) j++; + int openBraces = 0; + while (linePtr[j] != '\0') + { + if (((linePtr[j] == ' ') || (linePtr[j] == '\t')) && (openBraces == 0)) break; + if (linePtr[j] == '(') openBraces++; + if (linePtr[j] == ')') openBraces--; + j++; + } int defineNameEnd = j-1; // Skip duplicates