+#include "wx/dynlib.h"
+#include "wx/filefn.h"
+#include "wx/intl.h"
+#include "wx/log.h"
+#include "wx/tokenzr.h"
+
+// ----------------------------------------------------------------------------
+// conditional compilation
+// ----------------------------------------------------------------------------
+
+#if defined(__WXPM__) || defined(__EMX__)
+# define INCL_DOS
+# include <os2.h>
+# define wxDllOpen(error, lib, handle) DosLoadModule(error, sizeof(error), lib, &handle)
+# define wxDllGetSymbol(handle, modaddr) DosQueryProcAddr(handle, 1L, NULL, (PFN*)modaddr)
+# define wxDllClose(handle) DosFreeModule(handle)
+#elif defined(HAVE_DLOPEN)
+# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_NOW/*RTLD_LAZY*/)
+# define wxDllGetSymbol(handle, name) dlsym(handle, name)
+# define wxDllClose dlclose
+#elif defined(HAVE_SHL_LOAD)
+# define wxDllOpen(lib) shl_load(lib.fn_str(), BIND_DEFERRED, 0)
+# define wxDllClose shl_unload
+
+ static inline void *wxDllGetSymbol(shl_t handle, const wxString& name)
+ {
+ void *sym;
+ if ( shl_findsym(&handle, name.mb_str(), TYPE_UNDEFINED, &sym) == 0 )
+ return sym;
+ else
+ return (void *)0;
+ }
+#elif defined(__WINDOWS__)
+ // using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
+# ifdef __WIN32__
+#ifdef _UNICODE
+# define wxDllOpen(lib) ::LoadLibraryExW(lib, 0, 0)
+#else
+# define wxDllOpen(lib) ::LoadLibraryExA(lib, 0, 0)