From 868ce89db2a59315804953695d2897668b3d6a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 3 Mar 2019 20:34:41 +0100 Subject: [PATCH 1/2] Add some missing defined(__HAIKU__) Some places should rather check for HAVE_DLOPEN or alike though. --- effects/internal/vsthost.cpp | 4 ++-- io/crossplatformlib.cpp | 4 ++-- io/crossplatformlib.h | 2 +- project/effectloaders.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/effects/internal/vsthost.cpp b/effects/internal/vsthost.cpp index 110c31312..89fa02cdc 100644 --- a/effects/internal/vsthost.cpp +++ b/effects/internal/vsthost.cpp @@ -146,7 +146,7 @@ void VSTHost::loadPlugin() { #ifdef _WIN32 DWORD dll_err = GetLastError(); dll_error = QString::number(dll_err); -#elif __linux__ +#elif defined(__linux__) || defined(__HAIKU__) dll_error = dlerror(); #endif qCritical() << "Failed to load VST plugin" << dll_fn << "-" << dll_error; @@ -363,7 +363,7 @@ void VSTHost::show_interface(bool show) { dispatcher(plugin, effEditOpen, 0, 0, reinterpret_cast(dialog->windowHandle()->winId()), 0); #elif defined(__APPLE__) dispatcher(plugin, effEditOpen, 0, 0, reinterpret_cast(dialog->windowHandle()->winId()), 0); -#elif defined(__linux__) +#elif defined(__linux__) || defined(__HAIKU__) dispatcher(plugin, effEditOpen, 0, 0, reinterpret_cast(dialog->windowHandle()->winId()), 0); #endif } else { diff --git a/io/crossplatformlib.cpp b/io/crossplatformlib.cpp index b669a7b21..f5b7d486b 100644 --- a/io/crossplatformlib.cpp +++ b/io/crossplatformlib.cpp @@ -26,7 +26,7 @@ ModulePtr LibLoad(const QString &filename) { #ifdef _WIN32 LPCWSTR dll_fn_w = reinterpret_cast(filename.utf16()); return LoadLibrary(dll_fn_w); -#elif defined(__linux__) || defined(__APPLE__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__HAIKU__) 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"; @@ -37,7 +37,7 @@ ModulePtr LibLoad(const QString &filename) { QStringList LibFilter() { #ifdef _WIN32 return QStringList("*.dll"); -#elif defined(__linux__) || defined(__APPLE__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__HAIKU__) return {"*.so", "*.dylib"}; #endif } diff --git a/io/crossplatformlib.h b/io/crossplatformlib.h index 387d16691..bd1935a7d 100644 --- a/io/crossplatformlib.h +++ b/io/crossplatformlib.h @@ -28,7 +28,7 @@ #define LibAddress GetProcAddress #define LibClose FreeModule #define ModulePtr HMODULE -#elif defined(__linux__) || defined(__APPLE__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__HAIKU__) #include #define LibAddress dlsym #define LibClose dlclose diff --git a/project/effectloaders.cpp b/project/effectloaders.cpp index e2da64487..443caec1e 100644 --- a/project/effectloaders.cpp +++ b/project/effectloaders.cpp @@ -231,7 +231,7 @@ void load_frei0r_effects() { QList effect_dirs = get_effects_paths(); // add defined paths for frei0r plugins on unix -#if defined(__APPLE__) || defined(__linux__) +#if defined(__APPLE__) || defined(__linux__) || defined(__HAIKU__) effect_dirs.prepend("/usr/lib/frei0r-1"); effect_dirs.prepend("/usr/local/lib/frei0r-1"); effect_dirs.prepend(QDir::homePath() + "/.frei0r-1/lib"); From 03e1e988d07f91a7c7c4208f2429bf7d8fafcacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 3 Mar 2019 20:35:57 +0100 Subject: [PATCH 2/2] Haiku doesn't need libdl for dlopen. --- olive.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/olive.pro b/olive.pro index ddaedc3c5..f31ec75ab 100644 --- a/olive.pro +++ b/olive.pro @@ -304,6 +304,8 @@ mac { unix:!mac { CONFIG += link_pkgconfig PKGCONFIG += libavutil libavformat libavcodec libavfilter libswscale libswresample +} +unix:!mac:!haiku { LIBS += -ldl }