I have this macro from someone’s code:
#define Q_DEF_PROTOTYPE( Type, Name ) Type (*Name)
#define COPY_FP( pDest, pSrc ) (*((void**)(&(pDest)))) = ((void*)(pSrc))
#define LIB_QUERY(lib_handle, proc) dlsym(lib_handle, proc)
#define Q_DEF_PROTOTYPE( Type, Name ) \
COPY_FP( p->Name, LIB_QUERY( g_library, STRINGIZE(FUNC(Name)) ) ); \
void dummy_##Name
Not sure, what “void dummy_##Name” does? Thanks.
It replace the
##Namewith the value of Name parameter as string.Q_DEF_PROTOTYPE(myType, objectName) => void dummy_objectName