added wxDynamicLibrary::HasSymbol()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -314,12 +314,11 @@ void wxDynamicLibrary::Unload(wxDllType handle)
|
||||
#endif
|
||||
}
|
||||
|
||||
void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
||||
void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const
|
||||
{
|
||||
wxCHECK_MSG( IsLoaded(), NULL,
|
||||
_T("Can't load symbol from unloaded library") );
|
||||
|
||||
bool failed = false;
|
||||
void *symbol = 0;
|
||||
|
||||
wxUnusedVar(symbol);
|
||||
@@ -360,6 +359,15 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
||||
#error "runtime shared lib support not implemented"
|
||||
#endif
|
||||
|
||||
if ( success )
|
||||
*success = symbol != NULL;
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
||||
void *wxDynamicLibrary::GetSymbol(const wxString& name, bool *success) const
|
||||
{
|
||||
void *symbol = DoGetSymbol(name, success);
|
||||
if ( !symbol )
|
||||
{
|
||||
#if defined(HAVE_DLERROR) && !defined(__EMX__)
|
||||
@@ -376,18 +384,14 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
||||
wxLogError(wxT("%s"), err);
|
||||
}
|
||||
#else
|
||||
failed = true;
|
||||
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
||||
name.c_str());
|
||||
#endif
|
||||
}
|
||||
if( success )
|
||||
*success = !failed;
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
||||
|
||||
/*static*/
|
||||
wxString
|
||||
wxDynamicLibrary::CanonicalizeName(const wxString& name,
|
||||
|
Reference in New Issue
Block a user