From f7e999cf187cc2436aa8a809cc72de7317b87b73 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 18 Feb 2016 10:37:14 +0300 Subject: [PATCH] fix MSVC compatibility * add missing CINDEX_LINKAGE to exported functions * eliminate C2276 MSVC++ error on static member reference --- include/clang-c/Index.h | 10 +++++----- include/clang/Basic/SourceMgrAdapter.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index c3e443808d5..73893c41aa8 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -5078,19 +5078,19 @@ CINDEX_LINKAGE CXEvalResult clang_Cursor_Evaluate(CXCursor C); /** * \brief Returns the kind of the evaluated result. */ -CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E); +CINDEX_LINKAGE CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E); /** * \brief Returns the evaluation result as integer if the * kind is Int. */ -int clang_EvalResult_getAsInt(CXEvalResult E); +CINDEX_LINKAGE int clang_EvalResult_getAsInt(CXEvalResult E); /** * \brief Returns the evaluation result as double if the * kind is double. */ -double clang_EvalResult_getAsDouble(CXEvalResult E); +CINDEX_LINKAGE double clang_EvalResult_getAsDouble(CXEvalResult E); /** * \brief Returns the evaluation result as a constant string if the @@ -5098,12 +5098,12 @@ double clang_EvalResult_getAsDouble(CXEvalResult E); * instead call clang_EvalResult_dispose on the CXEvalResult returned * by clang_Cursor_Evaluate. */ -const char* clang_EvalResult_getAsStr(CXEvalResult E); +CINDEX_LINKAGE const char* clang_EvalResult_getAsStr(CXEvalResult E); /** * \brief Disposes the created Eval memory. */ -void clang_EvalResult_dispose(CXEvalResult E); +CINDEX_LINKAGE void clang_EvalResult_dispose(CXEvalResult E); /** * @} */ diff --git a/include/clang/Basic/SourceMgrAdapter.h b/include/clang/Basic/SourceMgrAdapter.h index 6782aebbeff..81d81cbf2f5 100644 --- a/include/clang/Basic/SourceMgrAdapter.h +++ b/include/clang/Basic/SourceMgrAdapter.h @@ -70,7 +70,7 @@ class SourceMgrAdapter { void handleDiag(const llvm::SMDiagnostic &diag); /// Retrieve the diagnostic handler to use with the underlying SourceMgr. - llvm::SourceMgr::DiagHandlerTy getDiagHandler() { return &handleDiag; } + llvm::SourceMgr::DiagHandlerTy getDiagHandler() { return &SourceMgrAdapter::handleDiag; } /// Retrieve the context to use with the diagnostic handler produced by /// \c getDiagHandler().