korlibs-archive/klock

Invalid variable name when generating Objective-C header file

Skeptick opened this issue · 2 comments

When exporting the library to iOS -framework, the compiler throws errors, and in the generated header file highlights the error on this line:

@property (readonly) MppLibraryWTimeSpan *NULL __attribute__((swift_name("NULL")));

https://github.com/korlibs/klock/blob/68b142fc3eb4a2f25096ccbe59d5ca2a5397f868/klock/src/commonMain/kotlin/com/soywiz/klock/wrapped/WTimeSpan.kt#L76
It looks like NULL cannot be used as a name for a property.
Perhaps it makes sense to rename it? :)

Also, I would be grateful if you can tell me how to exclude one specific file from export.

Created this issue: https://youtrack.jetbrains.com/issue/KT-40465

Maybe we can rename it to NIL for now

This fix will be available on the next major version since this is a breaking change.