* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 27
+#define CINDEX_VERSION_MINOR 28
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
CINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu,
const char *file_name);
+/**
+ * \brief Returns non-zero if the \c file1 and \c file2 point to the same file,
+ * or they are both NULL.
+ */
+CINDEX_LINKAGE int clang_File_isEqual(CXFile file1, CXFile file2);
+
/**
* @}
*/
return 0;
}
+int clang_File_isEqual(CXFile file1, CXFile file2) {
+ if (file1 == file2)
+ return true;
+
+ if (!file1 || !file2)
+ return false;
+
+ FileEntry *FEnt1 = static_cast<FileEntry *>(file1);
+ FileEntry *FEnt2 = static_cast<FileEntry *>(file2);
+ return FEnt1->getUniqueID() == FEnt2->getUniqueID();
+}
+
} // end: extern "C"
//===----------------------------------------------------------------------===//