blob: 4a71635e64a607713875c5908fb4012a89e6e229 (
plain) (
tree)
|
|
#define MOCK_WRAPPER_IMPL(ret, fn) \
/* do common work */ \
static ret wrap_##fn(...);
// Utility to generate wrapper boilerplate.
#define WRAP(ret, fn, typed_args, args) \
MOCK_WRAPPER_IMPL(ret, fn) \
\
extern "C" ret fn typed_args { \
return wrap_##fn args; \
}
WRAP(int, foo, (const char* name), (name))
WRAP(int, bar, (const char* name, const char* value), (name, value))
|