Browse Source

cppparser: Skip comments after preprocessor directive

See #1635
mingodad 1 year ago
parent
commit
685b98021c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      dtool/src/cppparser/cppPreprocessor.cxx

+ 3 - 0
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();