first commit
This commit is contained in:
31
inc/hgl/platform/FuncLoad.h
Normal file
31
inc/hgl/platform/FuncLoad.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef HGL_FUNC_LOAD_INCLUDE
|
||||
#define HGL_FUNC_LOAD_INCLUDE
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
/**
|
||||
* 函数加载定义数据结构
|
||||
*/
|
||||
struct FuncLoad
|
||||
{
|
||||
char func_name[64]; ///<函数名称
|
||||
void **func_pointer; ///<函数指针
|
||||
};//struct FuncLoad
|
||||
|
||||
#define HGL_FUNC_LOAD_LIST_BEGIN(name) struct FuncLoad name[]={
|
||||
#define HGL_FUNC_LOAD(name) {#name,(void **)&name},
|
||||
#define HGL_FUNC_LOAD_LIST_END {"",(void **)0}};
|
||||
|
||||
inline void ClearFuncLoadPointer(struct FuncLoad *flp)
|
||||
{
|
||||
if(!flp)return;
|
||||
|
||||
while(flp->func_pointer)
|
||||
{
|
||||
flp->func_pointer=(void **)0;
|
||||
|
||||
++flp;
|
||||
}
|
||||
}
|
||||
}//namespace hgl
|
||||
#endif//HGL_FUNC_LOAD_INCLUDE
|
Reference in New Issue
Block a user