Olive
crossplatformlib.h
1 #ifndef CROSSPLATFORMLIB_H
2 #define CROSSPLATFORMLIB_H
3 
4 #include <QString>
5 
6 #ifdef _WIN32
7  #include <Windows.h>
8  #define LibAddress GetProcAddress
9  #define LibClose FreeModule
10  #define ModulePtr HMODULE
11 #elif defined(__linux__) || defined(__APPLE__)
12  #include <dlfcn.h>
13  #define LibAddress dlsym
14  #define LibClose dlclose
15  #define ModulePtr void*
16 #endif
17 
18 ModulePtr LibLoad(const QString& filename);
19 QStringList LibFilter();
20 
21 #ifdef __APPLE__
22 #include <CoreFoundation/CoreFoundation.h>
23 class NSWindow;
24 
25 CFBundleRef BundleLoad(const QString& filename);
26 void BundleClose(CFBundleRef bundle);
27 #endif
28 
29 #endif // CROSSPLATFORMLIB_H