https://github.com/boazsegev/facil.io/blob/master/lib/facil/...
I've seen other hacks to do this, but this is the cleanest that I've seen. He uses the same name for the macro and the function.
The only thing I would change is the way the struct is passed. I would pass by reference.
I really like this.