[K/N] Replace SymbolName with GCUnsafeCall in interop

This commit is contained in:
Pavel Kunyavskiy
2021-09-03 17:12:52 +03:00
committed by Space
parent 91c6ee1ebb
commit ca9ec76c08
5 changed files with 8 additions and 4 deletions
@@ -123,7 +123,8 @@ class SimpleBridgeGeneratorImpl(
val externCPrefix = if (libraryForCStubs.language == Language.CPP) "extern \"C\" " else ""
val functionName = pkgName.replace(INVALID_CLANG_IDENTIFIER_REGEX, "_") + "_$kotlinFunctionName"
if (independent) kotlinLines.add("@" + topLevelKotlinScope.reference(KotlinTypes.independent))
kotlinLines.add("@SymbolName(${functionName.quoteAsKotlinLiteral()})")
// TODO: this should be separate annotation
kotlinLines.add("@GCUnsafeCall(${functionName.quoteAsKotlinLiteral()})")
"$externCPrefix$cReturnType $functionName ($joinedCParameters)"
}
}