]> granicus.if.org Git - clang/commitdiff
[libclang] Fix "error: conflicts with new declaration with ā€˜C’ linkage" that gcc
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 11 Apr 2012 03:52:18 +0000 (03:52 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 11 Apr 2012 03:52:18 +0000 (03:52 +0000)
emits but not clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154475 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndex.cpp

index df4c8eda667ef949fcafdb489ac87a6ad1b10556..67c56a26746636ab7945d7c27064ecbfe17b3ad7 100644 (file)
@@ -2484,27 +2484,6 @@ clang_createTranslationUnitFromSourceFile(CXIndex CIdx,
                                     Options);
 }
 
-void cxindex::printDiagsToStderr(ASTUnit *Unit) {
-  if (!Unit)
-    return;
-
-  for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(), 
-                                  DEnd = Unit->stored_diag_end();
-       D != DEnd; ++D) {
-    CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOpts());
-    CXString Msg = clang_formatDiagnostic(&Diag,
-                                clang_defaultDiagnosticDisplayOptions());
-    fprintf(stderr, "%s\n", clang_getCString(Msg));
-    clang_disposeString(Msg);
-  }
-#ifdef LLVM_ON_WIN32
-  // On Windows, force a flush, since there may be multiple copies of
-  // stderr and stdout in the file system, all with different buffers
-  // but writing to the same device.
-  fflush(stderr);
-#endif
-}
-
 struct ParseTranslationUnitInfo {
   CXIndex CIdx;
   const char *source_filename;
@@ -5831,6 +5810,27 @@ void clang::setThreadBackgroundPriority() {
 #endif
 }
 
+void cxindex::printDiagsToStderr(ASTUnit *Unit) {
+  if (!Unit)
+    return;
+
+  for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(), 
+                                  DEnd = Unit->stored_diag_end();
+       D != DEnd; ++D) {
+    CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOpts());
+    CXString Msg = clang_formatDiagnostic(&Diag,
+                                clang_defaultDiagnosticDisplayOptions());
+    fprintf(stderr, "%s\n", clang_getCString(Msg));
+    clang_disposeString(Msg);
+  }
+#ifdef LLVM_ON_WIN32
+  // On Windows, force a flush, since there may be multiple copies of
+  // stderr and stdout in the file system, all with different buffers
+  // but writing to the same device.
+  fflush(stderr);
+#endif
+}
+
 extern "C" {
 
 CXString clang_getClangVersion() {