瀏覽代碼

LibCpp: Ignore the #error preprocessor directive

Ali Mohammad Pur 2 年之前
父節點
當前提交
12a900b97c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Userland/Libraries/LibCpp/Preprocessor.cpp

+ 4 - 0
Userland/Libraries/LibCpp/Preprocessor.cpp

@@ -230,6 +230,10 @@ void Preprocessor::handle_preprocessor_keyword(StringView keyword, GenericLexer&
         line_lexer.consume_all();
         return;
     }
+    if (keyword == "error") {
+        line_lexer.consume_all();
+        return;
+    }
 
     if (!m_options.ignore_unsupported_keywords) {
         dbgln("Unsupported preprocessor keyword: {}", keyword);