Generate a function via macro and pass to @cfunction. Possible?

Thanks for the reply and the explanation.

Is there any way to automatically define the wrapper function before @cfunction is evaluated?

I want to have the implementation as user-friendly as possible and avoid that the user needs to first define a wrapper in global scope. It would be convenient if all of this could happen within one macro or function call.