#include #include #include static void thefunc_one(void) { printf("This is thefunc one\n"); } static void thefunc_two(void) { printf("This is thefunc two\n"); } static void thefunc_three(void) { printf("This is thefunc three\n"); } static void thefunc_four(void) { printf("This is thefunc four\n"); } void *memset_std(void *buf, int c, size_t len); void *memset_erms(void *buf, int c, size_t len); DEFINE_IFUNC(, void, thefunc, (void), static) { int foo = 0; /* arc4random_uniform(4) */ switch (foo + 1) { default: return &thefunc_four; case 0: return &thefunc_one; case 1: return &thefunc_two; case 2: return &thefunc_three; } } int main(int argc, char* argv[]) { printf("Inside program!\n"); thefunc(); thefunc(); return 0; }