diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-09-22 15:20:15 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-09-22 15:20:15 +0200 |
commit | 45d89cfd526bf7fa3f7865f2e78f10cd9a85a2f6 (patch) | |
tree | aed64af7cf9f2bab419b6d4e80f0dcc9dd9eb47e /facetracknoir/plugin-support.cpp | |
parent | 350edf6e5c1f253a300fd0b7db6591082558d937 (diff) |
fix Linux build
Diffstat (limited to 'facetracknoir/plugin-support.cpp')
-rw-r--r-- | facetracknoir/plugin-support.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/facetracknoir/plugin-support.cpp b/facetracknoir/plugin-support.cpp index 71279cb9..c6622fe0 100644 --- a/facetracknoir/plugin-support.cpp +++ b/facetracknoir/plugin-support.cpp @@ -1,5 +1,6 @@ #include "plugin-support.h" #include <QCoreApplication> +#include <QFile> #if !(defined(_WIN32)) # include <dlfcn.h> @@ -109,23 +110,25 @@ DynamicLibrary::DynamicLibrary(const QString& filename) : 0 # endif ); - if (handle) - { - struct _foo { - static bool err(void*& handle) + + struct _foo { + static bool err(void*& handle) + { + const char* err = dlerror(); + if (err) { - const char* err = dlerror(); - if (err) - { - fprintf(stderr, "Error, ignoring: %s\n", err); - fflush(stderr); - dlclose(handle); - handle = nullptr; - return true; - } - false; + fprintf(stderr, "Error, ignoring: %s\n", err); + fflush(stderr); + dlclose(handle); + handle = nullptr; + return true; } - }; + false; + } + }; + + if (handle) + { if (_foo::err(handle)) return; Dialog = (DIALOG_FUNPTR) dlsym(handle, "GetDialog"); |