-#if defined( HAVE_DLOPEN ) && !defined(__EMX__)
- return dlopen(0, RTLD_LAZY);
-#elif defined (HAVE_SHL_LOAD)
- return PROG_HANDLE;
-#else
- wxFAIL_MSG( wxT("This method is not implemented under Windows or OS/2"));
- return 0;
-#endif
-}
-
-bool wxDynamicLibrary::Load(wxString libname, int flags)
-{
- wxASSERT_MSG(m_handle == 0, _T("Library already loaded."));
-
- if( !(flags & wxDL_VERBATIM) )
- libname += GetDllExt();
-
-#if defined(__WXMAC__) && !defined(__UNIX__)
- FSSpec myFSSpec;
- Ptr myMainAddr;
- Str255 myErrName;
-
- wxMacFilename2FSSpec( libname , &myFSSpec );
-
- if( GetDiskFragment( &myFSSpec,
- 0,
- kCFragGoesToEOF,
- "\p",
- kPrivateCFragCopy,
- &m_handle,
- &myMainAddr,
- myErrName ) != noErr )
- {
- p2cstr( myErrName );
- wxLogSysError( _("Failed to load shared library '%s' Error '%s'"),
- libname.c_str(),
- (char*)myErrName );
- m_handle = 0;
- }
-
-#elif defined(__WXPM__) || defined(__EMX__)
- char err[256] = "";
- DosLoadModule(err, sizeof(err), libname.c_str(), &m_handle)
-
-#elif defined(HAVE_DLOPEN)
-
-#ifdef __VMS
- m_handle = dlopen(libname.c_str(), 0); // The second parameter is ignored
-#else
- int rtldFlags = 0;
-
- if( flags & wxDL_LAZY )
- {
- wxASSERT_MSG( (flags & wxDL_NOW) == 0,
- _T("wxDL_LAZY and wxDL_NOW are mutually exclusive.") );
- rtldFlags |= RTLD_LAZY;
- }
- else if( flags & wxDL_NOW )
- {
- rtldFlags |= RTLD_NOW;
- }
- if( flags & wxDL_GLOBAL )
- {
-#ifdef __osf__
- wxLogDebug(_T("WARNING: RTLD_GLOBAL is not a supported on this platform."));
-#endif
- rtldFlags |= RTLD_GLOBAL;
- }
-
- m_handle = dlopen(libname.c_str(), rtldFlags);
-#endif // __VMS
-
-#elif defined(HAVE_SHL_LOAD)
- int shlFlags = 0;