Alvaro Gracia
12/10/2024, 12:00 PMstruct LogMessage {
unsigned int level;
char message[1024];
};
The struct is imported as:
@kotlinx.cinterop.ExperimentalForeignApi public final expect class LogMessage public constructor(rawPtr: kotlin.native.internal.NativePtr /* from: kotlinx.cinterop.NativePtr */) : kotlinx.cinterop.CStructVar {
@kotlin.Deprecated public expect companion object : kotlinx.cinterop.CStructVar.Type {
}
public expect final var level: kotlin.UInt /* from: cocoapods.SDK.LogLevel */ /* compiled code */
public expect final val message: kotlinx.cinterop.CPointer<kotlinx.cinterop.ByteVarOf<kotlin.Byte>> /* from: kotlinx.cinterop.CArrayPointer<kotlinx.cinterop.ByteVarOf<kotlin.Byte> /* from: kotlinx.cinterop.ByteVar */> */ /* compiled code */
}
Now I'm trying to create an instance of the LogMessage struct in Kotlin side.
The problem is that the message property is declared as val, so there's no way to set it.
Do you know how to solve this?
Thank you in advance