Custom exception hook in reverse C interop (#2946)
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#define T_(x) testlib_kref_ ## x
|
||||
#define CAST(T, v) testlib_kref_ ## T { .pinned = v }
|
||||
|
||||
void errorHandler(const char* str) {
|
||||
printf("Error handler: %s\n", str);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
T_(Singleton) singleton = __ kotlin.root.Singleton._instance();
|
||||
T_(Base) base = __ kotlin.root.Base.Base();
|
||||
@@ -61,6 +65,9 @@ int main(void) {
|
||||
__ DisposeStablePointer(enum1.pinned);
|
||||
__ DisposeStablePointer(object1.pinned);
|
||||
|
||||
__ kotlin.root.setCErrorHandler(&errorHandler);
|
||||
__ kotlin.root.throwException();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user