summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKornel Lesiński <kornel@geekhood.net>2017-02-08 16:53:06 +0000
committerKornel Lesiński <kornel@geekhood.net>2017-02-08 17:03:25 +0000
commit51c3ac628fd96ded822f12a60f3940bbff205564 (patch)
tree8419af963bafca827c6cc1e84d8cdc71ffcd0448 /src
parent86380b55a6103d6f01bd5a573d216fafce52c374 (diff)
Fallback for clang_Cursor_getMangling absent in Clang 3.5
Diffstat (limited to 'src')
-rw-r--r--src/clang.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 86eccd0c..a2b4ee0f 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -69,7 +69,11 @@ impl Cursor {
/// Get the mangled name of this cursor's referent.
pub fn mangling(&self) -> String {
- unsafe { cxstring_into_string(clang_Cursor_getMangling(self.x)) }
+ if clang_Cursor_getMangling::is_loaded() {
+ unsafe { cxstring_into_string(clang_Cursor_getMangling(self.x)) }
+ } else {
+ self.spelling()
+ }
}
/// Get the `Cursor` for this cursor's referent's lexical parent.