X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b7b35e5063b8430324ba2fa05d5e6f58a34dd3b9..52cd14b1c8c74a8d52d5a4ae9a31cfa1d123297a:/src/common/dynlib.cpp diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index b6cbcec443..a452cb2c82 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -6,7 +6,7 @@ // Created: 20/07/98 // RCS-ID: $Id$ // Copyright: (c) Guilhem Lavaux -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -99,7 +99,11 @@ const char *dlerror(void); // using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary # ifdef __WIN32__ #ifdef _UNICODE +#ifdef __WXWINCE__ +# define wxDllOpen(lib) ::LoadLibrary(lib) +#else # define wxDllOpen(lib) ::LoadLibraryExW(lib, 0, 0) +#endif #else # define wxDllOpen(lib) ::LoadLibraryExA(lib, 0, 0) #endif @@ -146,7 +150,7 @@ wxLibrary::wxLibrary(wxDllType handle) m_handle = handle; // Some system may use a local heap for library. - get_first = (t_get_first)GetSymbol("wxGetClassFirst"); + get_first = (t_get_first)GetSymbol(_T("wxGetClassFirst")); // It is a wxWindows DLL. if (get_first) PrepareClasses(get_first()); @@ -310,12 +314,8 @@ void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *su CFragSymbolClass symClass; Str255 symName; -#if TARGET_CARBON - c2pstrcpy( (StringPtr) symName, name ); -#else - strcpy( (char *) symName, name ); - c2pstr( (char *) symName ); -#endif + wxMacStringToPascal( name.c_str() , symName ) ; + if( FindSymbol( ((CFragConnectionID)dllHandle), symName, &symAddress, &symClass ) == noErr ) symbol = (void *)symAddress; @@ -327,20 +327,21 @@ void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *su // mb_str() is necessary in Unicode build // // "void *" cast is needed by gcc 3.1 + w32api 1.4, don't ask me why - symbol = (void *)wxDllGetSymbol(dllHandle, name.mb_str()); +#ifdef __WXWINCE__ + symbol = (void *) wxDllGetSymbol(dllHandle, name.c_str()); +#else + symbol = (void *) wxDllGetSymbol(dllHandle, name.mb_str()); +#endif #endif // OS if ( !symbol ) { - wxString msg(_("wxDllLoader failed to GetSymbol '%s'")); - #ifdef HAVE_DLERROR const wxChar *err = dlerror(); if( err ) { - failed = TRUE; - wxLogError( msg, err ); + wxLogError(wxT("%s"), err); } #else failed = TRUE; @@ -487,15 +488,19 @@ int dlclose(void *handle) return 0; } -void *dlsym(void *WXUNUSED(handle), const char *symbol) +void *dlsym(void *handle, const char *symbol) { void *addr; + + NSSymbol nsSymbol = NSLookupSymbolInModule( handle , symbol ) ; - if (NSIsSymbolNameDefined(symbol)) { - addr = NSAddressOfSymbol(NSLookupAndBindSymbol(symbol)); + if ( nsSymbol) + { + addr = NSAddressOfSymbol(nsSymbol); } - else { - addr = NULL; + else + { + addr = NULL; } return addr; }