The convention of the project is that every function that has to deal with an error condition has an "error" label. These macro a used to jump to that label to clean up the function before returning. Here's an example:
I think that this use of gotos is more clear than the alternative of a lot of nested if statements checking for success or having the clean up logic duplicated in a lot of places.
https://github.com/zedshaw/mongrel2/blob/master/src/http11/h...
A nicer example of the use of goto's in Mongrel2 is the check macro:
https://github.com/zedshaw/mongrel2/blob/a884aef0f4a460e130d...
The convention of the project is that every function that has to deal with an error condition has an "error" label. These macro a used to jump to that label to clean up the function before returning. Here's an example:
https://github.com/zedshaw/mongrel2/blob/a884aef0f4a460e130d...
I think that this use of gotos is more clear than the alternative of a lot of nested if statements checking for success or having the clean up logic duplicated in a lot of places.