diff --git a/docs/changes.txt b/docs/changes.txt index 62a64151e4..f591101f40 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -214,6 +214,11 @@ Unix: - wxPuts() now correctly outputs trailing new line in Unicode build +Mac: + +- wxDynamicLibrary::GetDllExt() now returns ".bundle", not ".dylib" +- wxDynamicLibrary::GetSymbol() now prepends underscore to the symbol name + wxGTK: - fixed wxFileDialog::SetWildcard() diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 95f14b9e21..ec3c142570 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -126,19 +126,12 @@ int dlclose(void *handle) void *dlsym(void *handle, const char *symbol) { - void *addr; - - NSSymbol nsSymbol = NSLookupSymbolInModule( handle , symbol ) ; - - if ( nsSymbol) - { - addr = NSAddressOfSymbol(nsSymbol); - } - else - { - addr = NULL; - } - return addr; + // as on many other systems, C symbols have prepended underscores under + // Darwin but unlike the normal dlopen(), NSLookupSymbolInModule() is not + // aware of this + NSSymbol nsSymbol = NSLookupSymbolInModule( handle, + wxString(_T('_')) + symbol ); + return nsSymbol ? NSAddressOfSymbol(nsSymbol) : NULL; } #endif // defined(__DARWIN__) @@ -159,7 +152,7 @@ void *dlsym(void *handle, const char *symbol) #if defined(__HPUX__) const wxChar *wxDynamicLibrary::ms_dllext = _T(".sl"); #elif defined(__DARWIN__) - const wxChar *wxDynamicLibrary::ms_dllext = _T(".dylib"); + const wxChar *wxDynamicLibrary::ms_dllext = _T(".bundle"); #else const wxChar *wxDynamicLibrary::ms_dllext = _T(".so"); #endif