diff --git a/extern/exception.m b/extern/exception.m index 700439e..73fc095 100644 --- a/extern/exception.m +++ b/extern/exception.m @@ -1,5 +1,5 @@ -#include -#include +// Available from `objc` +id objc_retain(id value); void RustObjCExceptionThrow(id exception) { @throw exception; @@ -9,12 +9,12 @@ int RustObjCExceptionTryCatch(void (*try)(void *), void *context, id *error) { @try { try(context); if (error) { - *error = nil; + *error = (id)0; // nil } return 0; } @catch (id exception) { if (error) { - *error = [exception retain]; + *error = objc_retain(exception); } return 1; }