Skip to content

Commit

Permalink
[runtime] Use xamarin_process_nsexception instead of xamarin_throw_ns…
Browse files Browse the repository at this point in the history
…_exception in our generated bindings. (#84)

This makes the generated bindings play nice with exception marshaling.
  • Loading branch information
rolfbjarne committed May 26, 2016
1 parent a5c7575 commit 5feea25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions runtime/bindings-generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ static void Write_objc_msgSend (StringWriter writer, FunctionData func)
// @catch
if (func.MarshalExceptions) {
writer.WriteLine ("\t} @catch (NSException *e) {");
writer.WriteLine ("\t\txamarin_throw_ns_exception (e);");
writer.WriteLine ("\t\txamarin_process_nsexception (e);");
writer.WriteLine ("\t}");
}

Expand Down Expand Up @@ -1579,7 +1579,7 @@ static void Write_objc_msgSendSuper (StringWriter writer, FunctionData func)
// @catch
if (func.MarshalExceptions) {
writer.WriteLine ("\t} @catch (NSException *e) {");
writer.WriteLine ("\t\txamarin_throw_ns_exception (e);");
writer.WriteLine ("\t\txamarin_process_nsexception (e);");
writer.WriteLine ("\t}");
}

Expand Down Expand Up @@ -1653,7 +1653,7 @@ static void Write_objc_msgSend_stret (StringWriter writer, FunctionData func)
// @catch
if (func.MarshalExceptions) {
writer.WriteLine ("\t} @catch (NSException *e) {");
writer.WriteLine ("\t\txamarin_throw_ns_exception (e);");
writer.WriteLine ("\t\txamarin_process_nsexception (e);");
writer.WriteLine ("\t}");
}

Expand Down Expand Up @@ -1727,7 +1727,7 @@ static void Write_objc_msgSendSuper_stret (StringWriter writer, FunctionData fun
// @catch
if (func.MarshalExceptions) {
writer.WriteLine ("\t} @catch (NSException *e) {");
writer.WriteLine ("\t\txamarin_throw_ns_exception (e);");
writer.WriteLine ("\t\txamarin_process_nsexception (e);");
writer.WriteLine ("\t}");
}

Expand Down
8 changes: 4 additions & 4 deletions runtime/bindings.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
return ((float_send) objc_msgSend) (self, sel);
#endif
} @catch (NSException *e) {
xamarin_throw_ns_exception (e);
xamarin_process_nsexception (e);
}
}

Expand All @@ -40,7 +40,7 @@
// there is no objc_msgSendSuper_fpret: http://lists.apple.com/archives/objc-language/2006/Jun/msg00012.html
return ((float_sendsuper) objc_msgSendSuper) (super, sel);
} @catch (NSException *e) {
xamarin_throw_ns_exception (e);
xamarin_process_nsexception (e);
}
}

Expand All @@ -54,7 +54,7 @@
return ((nfloat_send) objc_msgSend) (self, sel);
#endif
} @catch (NSException *e) {
xamarin_throw_ns_exception (e);
xamarin_process_nsexception (e);
}
}

Expand All @@ -65,7 +65,7 @@
// there is no objc_msgSendSuper_fpret: http://lists.apple.com/archives/objc-language/2006/Jun/msg00012.html
return ((nfloat_sendsuper) objc_msgSendSuper) (super, sel);
} @catch (NSException *e) {
xamarin_throw_ns_exception (e);
xamarin_process_nsexception (e);
}
}

Expand Down

0 comments on commit 5feea25

Please sign in to comment.