X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99d96a2b78b0db66d191400bb060713263096ca9..c3396917e888355d3e7060cbb238a66339d8feb5:/src/common/dynlib.cpp diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 39c53cd2ee..6830ec2265 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -53,9 +53,12 @@ // note about dlopen() flags: we use RTLD_NOW to have more Windows-like // behaviour (Win won't let you load a library with missing symbols) and // RTLD_GLOBAL because it is needed sometimes and probably doesn't hurt - // otherwise. On VMS the second argument on dlopen is ignored. + // otherwise. On True64-Unix RTLD_GLOBAL is not allowed and on VMS the + // second argument on dlopen is ignored. #ifdef __VMS # define wxDllOpen(lib) dlopen(lib.fn_str(), 0 ) +#elif defined( __osf__ ) +# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY ) #else # define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY | RTLD_GLOBAL) #endif @@ -73,6 +76,15 @@ else return (void *)0; } +#elif defined(__APPLE__) && defined(__UNIX__) +char *dlopen(char *path, int mode /* mode is ignored */); +void *dlsym(void *handle, char *symbol); +int dlclose(void *handle); +char *dlerror(); + +# define wxDllOpen(lib) dlopen(lib.fn_str(), 0) +# define wxDllGetSymbol(handle, name) dlsym(handle, name) +# define wxDllClose dlclose #elif defined(__WINDOWS__) // using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary # ifdef __WIN32__ @@ -218,7 +230,7 @@ wxDllLoader::LoadLibrary(const wxString & libname, bool *success) { wxDllType handle; -#if defined(__WXMAC__) +#if defined(__WXMAC__) && !defined(__UNIX__) FSSpec myFSSpec ; Ptr myMainAddr ; Str255 myErrName ; @@ -291,13 +303,17 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name) { void *symbol = NULL; // return value -#if defined( __WXMAC__ ) +#if defined(__WXMAC__) && !defined(__UNIX__) Ptr symAddress ; CFragSymbolClass symClass ; Str255 symName ; - strcpy( (char*) symName , name ) ; - c2pstr( (char*) symName ) ; +#if TARGET_CARBON + c2pstrcpy( (StringPtr) symName , name ) ; +#else + strcpy( (char *) symName , name ) ; + c2pstr( (char *) symName ) ; +#endif if ( FindSymbol( dllHandle , symName , &symAddress , &symClass ) == noErr ) symbol = (void *)symAddress ;