#define call_function(fun, member) fun##_##number ()
// ------------------------^
// should be "number".
Even so, you'll only get fun_i
. You can't call the preprocessor macros at runtime because they're used only in preprocessing (even before parsing and compiling).
You need to expand the loop manually.
call_function(fun, 0);
call_function(fun, 1);
call_function(fun, 2);
call_function(fun, 3);
call_function(fun, 4);
call_function(fun, 5);
call_function(fun, 6);
call_function(fun, 7);
call_function(fun, 8);
call_function(fun, 9);
Or use __COUNTER__
(needs gcc ≥ 4.3):
#define CONCAT3p(x,y,z) x##y##z
#define CONCAT3(x,y,z) CONCAT3p(x,y,z)
#define call_function(func) CONCAT3(func, _, __COUNTER__)()
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);
call_function(fun);