From 5eb017cd16ea8dad439028c34f4c0b4ea8e14855 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 1 Apr 2016 13:40:43 +0200 Subject: [PATCH] Added version check to Cursor::get_type --- src/Cursor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Cursor.cc b/src/Cursor.cc index 97a9174..1cc52dc 100644 --- a/src/Cursor.cc +++ b/src/Cursor.cc @@ -51,6 +51,7 @@ std::string clang::Cursor::get_type() { auto type=clang_getCursorType(referenced); spelling=clang::to_string(clang_getTypeSpelling(type)); +#if CINDEX_VERSION_MAJOR==0 && CINDEX_VERSION_MINOR<32 const std::string auto_str="auto"; if(spelling.size()>=4 && std::equal(auto_str.begin(), auto_str.end(), spelling.begin())) { auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor)); @@ -71,6 +72,8 @@ std::string clang::Cursor::get_type() { return canonical_spelling; } } +#endif + return spelling; }