From 685b98021c3a5e00cd33829792525684f4ab87c4 Mon Sep 17 00:00:00 2001 From: mingodad Date: Tue, 26 Mar 2024 15:52:57 +0100 Subject: [PATCH] cppparser: Skip comments after preprocessor directive See #1635 --- dtool/src/cppparser/cppPreprocessor.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index f594291e0c..575811c759 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -1452,6 +1452,9 @@ get_preprocessor_args(int c, string &args) { // Following the command, the rest of the line, as well as any text on // successive lines, is part of the arguments to the command. + // Check for comments first. + c = skip_comment(c); + while (c != EOF && c != '\n') { if (c == '\\') { int next_c = get();