[gnome-builder/gnome-builder-3-26] clang: check for KeepGoing availability



commit 35380e16337ee2a3276d10738904b60fe72b17f4
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 24 13:59:24 2017 -0700

    clang: check for KeepGoing availability
    
    If we are on older clang, we might not have access to the
    CXTranslationUnit_KeepGoing flag. This adds a simple version
    check to when we know it was added to the header.

 plugins/clang/ide-clang-service.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/plugins/clang/ide-clang-service.c b/plugins/clang/ide-clang-service.c
index cca34cc..c8be9c6 100644
--- a/plugins/clang/ide-clang-service.c
+++ b/plugins/clang/ide-clang-service.c
@@ -499,9 +499,11 @@ ide_clang_service_get_translation_unit_worker (DzlTaskCache  *cache,
    * quality highlighting, I'm going try try enabling it for now and see how
    * things go.
    */
-  request->options = (clang_defaultEditingTranslationUnitOptions () |
-                      CXTranslationUnit_DetailedPreprocessingRecord |
-                      CXTranslationUnit_KeepGoing);
+  request->options = (clang_defaultEditingTranslationUnitOptions ()
+#if CINDEX_VERSION >= CINDEX_VERSION_ENCODE(0, 35)
+                      | CXTranslationUnit_KeepGoing
+#endif
+                      | CXTranslationUnit_DetailedPreprocessingRecord);
 
   real_task = g_task_new (self,
                           g_task_get_cancellable (task),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]