Use the same function for logging dynlib errors on all platforms

Reduces the amount of #ifdefs scattered all over the code, thereby
simplifying the code.

The function was renamed from Error() to ReportError() to emphasize what
its purpose is.

Error messages logged on *nix are now a bit more verbose, as they are
prefixed with our own description text, which were earlier omitted on
platforms using the dlxxx() API.
This commit is contained in:
Lauri Nurmi
2020-04-26 23:43:58 +03:00
parent fb5c13ed00
commit c50784ba0b
4 changed files with 44 additions and 22 deletions

View File

@@ -357,11 +357,9 @@ protected:
// common part of GetSymbol() and HasSymbol()
void* DoGetSymbol(const wxString& name, bool* success = NULL) const;
#ifdef HAVE_DLERROR
// log the error after a dlxxx() function failure
static void Error();
#endif // HAVE_DLERROR
// log the error after an OS dynamic library function failure
static void ReportError(const wxString& msg,
const wxString& name = wxString());
// the handle to DLL or NULL
wxDllType m_handle;