#elif defined(__WXPM__) || defined(__EMX__)
wxDllGetSymbol(dllHandle, symbol);
-#else
+#else // Windows or Unix
+
// mb_str() is necessary in Unicode build
- symbol = wxDllGetSymbol(dllHandle, name.mb_str());
+ //
+ // "void *" cast is needed by gcc 3.1 + w32api 1.4, don't ask me why
+ symbol = (void *)wxDllGetSymbol(dllHandle, name.mb_str());
-#endif
+#endif // OS
if ( !symbol )
{
return NULL;
}
-#ifdef __DARWIN__
+#endif // wxUSE_DYNLIB_CLASS && !wxUSE_DYNAMIC_LOADER
+
+#if defined(__DARWIN__) && (wxUSE_DYNLIB_CLASS || wxUSE_DYNAMIC_LOADER)
// ---------------------------------------------------------------------------
// For Darwin/Mac OS X
// supply the sun style dlopen functions in terms of Darwin NS*
// ---------------------------------------------------------------------------
-#import <mach-o/dyld.h>
+#include <stdio.h>
+#include <mach-o/dyld.h>
static char dl_last_error[1024];
return dl_last_error;
}
-void *dlopen(const char *path, int mode /* mode is ignored */)
+void *dlopen(const char *path, int WXUNUSED(mode) /* mode is ignored */)
{
int dyld_result;
NSObjectFileImage ofile;
return 0;
}
-void *dlsym(void *handle, const char *symbol)
+void *dlsym(void *WXUNUSED(handle), const char *symbol)
{
void *addr;
return addr;
}
-#endif // __DARWIN__
-
-#endif // wxUSE_DYNLIB_CLASS
+#endif // defined(__DARWIN__) && (wxUSE_DYNLIB_CLASS || wxUSE_DYNAMIC_LOADER)