swog
swog copied to clipboard
Automatically transform String args to CString
In classes annotated with CObj, CxxObj, or ObjC, we should optionally transform String args passed to external functions into a CString, using a local zone. I.e.
@CObj
class Foo {
@transformArgs
def foo(arg: String): Unit = extern
should be semantically equivalent to
def foo(arg: CString): Unit = extern
def foo(arg: String): Unit = Zone{ implicit z =>
foo( toCString(arg) )
}
see also https://github.com/scala-native/scala-native/issues/1940