Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // >>>>>>>>>> NOT BY ME!!
- #ifdef _WIN32
- #include <windows.h>
- typedef HANDLE my_lib_t;
- #else
- #include <dlfcn.h>
- typedef void* my_lib_t;
- #endif
- my_lib_t MyLoadLib(const char* szMyLib) {
- # ifdef _WIN32
- return ::LoadLibraryA(szMyLib);
- # else //_WIN32
- return ::dlopen(szMyLib, RTLD_LAZY);
- # endif //_WIN32
- }
- void MyUnloadLib(my_lib_t hMyLib) {
- # ifdef _WIN32
- return ::FreeLibrary(hMyLib);
- # else //_WIN32
- return ::dlclose(hMyLib);
- # endif //_WIN32
- }
- void* MyLoadProc(my_lib_t hMyLib, const char* szMyProc) {
- # ifdef _WIN32
- return ::GetProcAddress(hMyLib, szMyProc);
- # else //_WIN32
- return ::dlsym(hMyLib, szMyProc);
- # endif //_WIN32
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement