ypedef void (*pf_goto_hell)(void);
typedef struct _ibm_func {
pf_goto_hell goto_hell;
} ibm_func;
typedef struct _sun_func {
pf_goto_hell goto_hell;
} sun_func;
......
ibm_func fibm;
sun_func fsun;
fibm.goto_hell = ...;
fsun.goto_hell = ...;
......
typedef struct _ibm_func {
pf_goto_hell goto_hell;
} ibm_func;
typedef struct _sun_func {
pf_goto_hell goto_hell;
} sun_func;
......
ibm_func fibm;
sun_func fsun;
fibm.goto_hell = ...;
fsun.goto_hell = ...;
......
定义一模一样都没问题,
放到结构体里面,动态加载嘛,程序初始化的时候,加载一遍,
比如,ibm函数全部放到ibm_func,
但是,sun也有自己的实现,那么,放到另一个结构体里面,
当然,结构体只是为了管理方便,思路是用指针保存起来,