From: Vadim Zeitlin Date: Sun, 17 Oct 2004 19:45:20 +0000 (+0000) Subject: - wxDynamicLibrary::GetDllExt() now returns ".bundle", not ".dylib" X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/42a245230195164b903533b72e5c809d14a7c858 - wxDynamicLibrary::GetDllExt() now returns ".bundle", not ".dylib" - wxDynamicLibrary::GetSymbol() now prepends underscore to the symbol name git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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