MCPcopy Create free account
hub / github.com/clMathLibraries/clSPARSE / LoadFunctionAddr

Function LoadFunctionAddr

src/include/loadDynamicLibrary.hpp:113–127  ·  view source on GitHub ↗

! * \brief Query for function pointer in library * \details This takes a shared module handle returned from LoadSharedLibrary, and a text string of a symbol * to load from the module, and returns a pointer to that symbol. If the symbol is not found, NULL * is returned. If the module handle is NULL, NULL is returned. * \param[in] libHandle Platform handle to the dynamic library * \param[in

Source from the content-addressed store, hash-verified

111 *
112 */
113inline void* LoadFunctionAddr(void* libHandle, std::string funcName)
114{
115 if (libHandle == NULL)
116 return NULL;
117
118#if defined( _WIN32 )
119 HMODULE fileHandle = reinterpret_cast<HMODULE>(libHandle);
120
121 void* pFunc = reinterpret_cast<void*>(::GetProcAddress(fileHandle, funcName.c_str()));
122#else
123 void* pFunc = ::dlsym( libHandle, funcName.c_str( ) );
124#endif
125
126 return pFunc;
127}
128
129#endif // _SHAREDLIBRARY_H_

Callers 2

clsparseCreateControlFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected