Преглед изворни кода

cppparser: Fix wide character literals in `#if`

rdb пре 1 година
родитељ
комит
ba51b2cdca
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      dtool/src/cppparser/cppPreprocessor.cxx

+ 4 - 0
dtool/src/cppparser/cppPreprocessor.cxx

@@ -919,6 +919,10 @@ expand_manifests(string &expr, const Manifests &manifests, bool expand_undefined
       else if (expand_undefined && ident == "__has_include") {
         expand_has_include_function(expr, q, p);
       }
+      else if (ident == "L" && p < expr.size() && (expr[p] == '\'' || expr[p] == '\"')) {
+        // Special exception for the wide string literal suffix, which is
+        // never expanded.
+      }
       else {
         // Is it a manifest?
         Manifests::const_iterator mi = manifests.find(ident);