napperley
01/21/2020, 2:35 AMe: /home/napperley/repos/gui_vista/guivista-core/src/linuxX64Main/kotlin/org/guiVista/core/gobject_utils.kt: (37, 12): Type mismatch: inferred type is gulong /* = UInt */ but ULong was expected
e: /home/napperley/repos/gui_vista/guivista-core/src/linuxX64Main/kotlin/org/guiVista/core/gobject_utils.kt: (52, 38): Type mismatch: inferred type is ULong but gulong /* = UInt */ was expected
Appears as though these are the only compile errors. Seem to be close to building the library for the linuxArm32Hfp target. Are there some subtle differences with data types between arm32hf and x64 I should be aware of with Kotlin Native?napperley
01/21/2020, 3:04 AMGLIB_AVAILABLE_IN_ALL
gulong g_signal_connect_data (gpointer instance,
const gchar *detailed_signal,
GCallback c_handler,
gpointer data,
GClosureNotify destroy_data,
GConnectFlags connect_flags);
napperley
01/21/2020, 3:07 AMGLIB_AVAILABLE_IN_ALL
gulong g_signal_connect_data(gpointer instance,
const gchar *detailed_signal,
GCallback c_handler,
gpointer data,
GClosureNotify destroy_data,
GConnectFlags connect_flags);
Artyom Degtyarev [JB]
01/21/2020, 8:47 AMArtyom Degtyarev [JB]
01/21/2020, 1:19 PMtypedef uint32_t KUInt;
typedef uint64_t KULong;
while Glib don’t go into such details.
typedef unsigned long gulong;
So, in some cases cinterop can produce different signatures for a different targets. For now, the best of available solutions here is to provide separate source sets.napperley
01/21/2020, 9:43 PMrusshwolf
01/21/2020, 11:33 PMNSInteger
type is an Int
in 32-bit things and a Long
in 64-bit. On some level I think you have to expect that sometimes when the architectures you’re building for differ.napperley
01/22/2020, 2:30 AMrusshwolf
01/22/2020, 4:38 AMNSUserDefaults.setInteger(NSInteger, String)
but NSInteger
changes based on architecture. So I define helper extensions NSUserDefaults.setInt()
and NSUserDefaults.setLong()
and these expect/actual to different implementations depending on whether we’re 32-bit or 64-bit.
Expect declarations: https://github.com/russhwolf/multiplatform-settings/blob/master/multiplatform-settings/src/appleMain/kotlin/com/russhwolf/settings/AppleSettings.kt#L168-L171
64-bit actual: https://github.com/russhwolf/multiplatform-settings/blob/master/multiplatform-settings/src/apple64Main/kotlin/com/russhwolf/settings/AppleSettings.kt#L21-L24
32-bit actual: https://github.com/russhwolf/multiplatform-settings/blob/master/multiplatform-settings/src/apple32Main/kotlin/com/russhwolf/settings/AppleSettings.kt#L21-L24
Usage: https://github.com/russhwolf/multiplatform-settings/blob/master/multiplatform-settings/src/appleMain/kotlin/com/russhwolf/settings/AppleSettings.kt#L82-L96