// 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
-# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY | RTLD_GLOBAL)
-# define wxDllGetSymbol(handle, name) dlsym(handle, name)
+ // 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
+#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)
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__
{
wxDllType handle;
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && !defined(__UNIX__)
FSSpec myFSSpec ;
Ptr myMainAddr ;
Str255 myErrName ;
{
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 ;