Expose interop enum .value through CEnum interface
This commit is contained in:
committed by
SvyatoslavScherbina
parent
88a69015d8
commit
a6b89e3a0d
@@ -214,6 +214,9 @@ sealed class CPrimitiveVar : CVariable {
|
||||
open class Type(size: Int) : CVariable.Type(size.toLong(), align = size)
|
||||
}
|
||||
|
||||
interface CEnum {
|
||||
val value: Number
|
||||
}
|
||||
abstract class CEnumVar : CPrimitiveVar()
|
||||
|
||||
// generics below are used for typedef support
|
||||
|
||||
+1
-1
@@ -612,7 +612,7 @@ class StubGenerator(
|
||||
|
||||
val baseTypeMirror = mirror(e.baseType)
|
||||
|
||||
block("enum class ${e.kotlinName.asSimpleName()}(val value: ${e.baseType.kotlinType})") {
|
||||
block("enum class ${e.kotlinName.asSimpleName()}(override val value: ${e.baseType.kotlinType}) : CEnum") {
|
||||
e.constants.forEach {
|
||||
out("${it.name.asSimpleName()}(${it.value}),")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user