Is there more than one way to work around the vari...
# kotlin-native
n
Is there more than one way to work around the variadic arguments limitation? Currently encountering this error:
When calling variadic C functions spread operator is supported only for *arrayOf(...)
. Looking at defining a function which takes a fixed number of parameters at the end (which is ungainly but it compiles), eg:
Copy code
fun addMultipleButtons(
    firstButtonText: String,
    responseId1: Int,
    responseId2: Int,
    responseId3: Int = 0,
    responseId4: Int = 0,
    responseId5: Int = 0
) {
    gtk_info_bar_add_buttons(
        info_bar = gtkInfoBarPtr,
        first_button_text = firstButtonText,
        variadicArguments = *arrayOf(responseId1, responseId2, responseId3, responseId4, responseId5, null)
    )
}