Support C enums with forward declarations
This commit is contained in:
committed by
SvyatoslavScherbina
parent
56b4e9c806
commit
fe2b680be8
+7
-1
@@ -240,7 +240,13 @@ internal class NativeIndexImpl(val library: NativeLibrary, val verbose: Boolean
|
||||
|
||||
private fun getEnumDefAt(cursor: CValue<CXCursor>): EnumDefImpl {
|
||||
if (clang_isCursorDefinition(cursor) == 0) {
|
||||
TODO("support enum forward declarations")
|
||||
val definitionCursor = clang_getCursorDefinition(cursor)
|
||||
if (clang_isCursorDefinition(definitionCursor) != 0) {
|
||||
return getEnumDefAt(definitionCursor)
|
||||
} else {
|
||||
TODO("support enum forward declarations: " +
|
||||
clang_getTypeSpelling(clang_getCursorType(cursor)).convertAndDispose())
|
||||
}
|
||||
}
|
||||
|
||||
return enumRegistry.getOrPut(cursor) {
|
||||
|
||||
Reference in New Issue
Block a user