Skip to content

Instantly share code, notes, and snippets.

@akrennmair
Created December 9, 2013 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akrennmair/7874363 to your computer and use it in GitHub Desktop.
Save akrennmair/7874363 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define FOO(type, rv) type myfunc_##type(void) { printf("%s called\n", __func__); return rv; }
FOO(int, 42)
FOO(void, )
int main() {
myfunc_void();
printf("%d\n", myfunc_int());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment