+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif //__BORLANDC__
+
+#if wxUSE_DYNLIB_CLASS
+
+#include "wx/dynlib.h"
+#include "wx/filefn.h"
+#include "wx/intl.h"
+#include "wx/log.h"
+#include "wx/tokenzr.h"
+
+// ----------------------------------------------------------------------------
+// conditional compilation
+// ----------------------------------------------------------------------------
+
+#if defined(HAVE_DLOPEN)
+ #define wxDllOpen(lib) dlopen(lib, RTLD_LAZY)
+ #define wxDllGetSymbol(handle, name) dlsym(handle, (char *)name)
+ #define wxDllClose dlclose
+#elif defined(HAVE_SHL_LOAD)
+ #define wxDllOpen(lib) shl_load(lib, BIND_DEFERRED, 0)
+ #define wxDllClose shl_unload
+
+ static inline void *wxDllGetSymbol(shl_t handle, const char *name)
+ {
+ void *sym;
+ if ( shl_findsym(&handle, name, TYPE_UNDEFINED, &sym) == 0 )
+ return sym;
+ else
+ return (void *)0;
+ }
+#elif defined(__WINDOWS__)
+ #include <windows.h>
+
+ // using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
+ #ifdef __WIN32__
+ #define wxDllOpen(lib) ::LoadLibraryEx(lib, 0, 0)
+ #else // Win16
+ #define wxDllOpen(lib) ::LoadLibrary(lib)
+ #endif // Win32/16
+ #define wxDllGetSymbol(handle, name) ::GetProcAddress(handle, name)
+ #define wxDllClose ::FreeLibrary
+#else
+ #error "Don't know how to load shared libraries on this platform."
+#endif // OS