added mac support to frei0r

This commit is contained in:
itsmattkc
2019-01-20 04:51:57 -08:00
parent db453f8dc1
commit f94a7677fd
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -6,7 +6,7 @@ ModulePtr LibLoad(const QString &filename) {
#ifdef _WIN32
LPCWSTR dll_fn_w = reinterpret_cast<const wchar_t*>(filename.utf16());
return LoadLibrary(dll_fn_w);
#elif __linux__
#elif defined(__linux__) || defined(__APPLE__)
return dlopen(filename.toUtf8(), RTLD_LAZY);
#else
qWarning() << "Olive doesn't know how to open dynamic libraries on this platform, external libraries will not be functional";
@@ -17,9 +17,7 @@ ModulePtr LibLoad(const QString &filename) {
QStringList LibFilter() {
#ifdef _WIN32
return QStringList("*.dll");
#elif __linux__
return QStringList("*.so");
#elif __APPLE__
return QStringList("*.dylib");
#elif defined(__linux__) || defined(__APPLE__)
return {"*.so", "*.dylib"};
#endif
}
+1 -1
View File
@@ -8,7 +8,7 @@
#define LibAddress GetProcAddress
#define LibClose FreeModule
#define ModulePtr HMODULE
#elif __linux__
#elif defined(__linux__) || defined(__APPLE__)
#include <dlfcn.h>
#define LibAddress dlsym
#define LibClose dlclose