Changeset 3605 in Sophya


Ignore:
Timestamp:
Apr 29, 2009, 12:15:21 PM (16 years ago)
Author:
ansari
Message:

Remplacement (MacOS X) des fonctions deprecated NSxxx de chargement dynamique par dlopen()... , Reza 29/04/2009

Location:
trunk/SophyaLib/SysTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/pdlmgr.cc

    r3226 r3605  
    2929  flavours (Linux, HP/Compaq/Digital OSF-Tru64, SGI IRIX, IBM AIX, Sun Solaris,
    3030  MacOS X/Darwin). \n
    31   For MacOS X/Darwin, the NSxxx API
     31  For MacOS X/Darwin (version <= 10.3), the NSxxx API
    3232  <tt> (NSLinkModule , NSCreateObjectFileImageFromFile, ...) </tt>
    33   is used.
     33  is used. From MacOSX v >= 10.4, NSxxx API is deprecated.
    3434  The example here shows the linking of shared library named "mylib.so"
    3535  containing a function \c double \c myfunction(double x).
     
    252252cerr << "PDynLinkMgr::PDynLinkMgr() Not yet available on HP-UX " << endl;
    253253return;
    254 #elif defined(Darwin)
     254#elif defined(Darwin) && ( GCC_VERSION <= 3350 )
    255255NSObjectFileImageReturnCode nsrc = NSCreateObjectFileImageFromFile(fnameso.c_str(), &nsobjfile);
    256256if (nsrc == NSObjectFileImageSuccess) {
     
    297297cerr << "PDynLinkMgr::~PDynLinkMgr() Not yet available on HP-UX " << endl;
    298298// return;
    299 #elif defined(Darwin)
     299#elif defined(Darwin) && ( GCC_VERSION <= 3350 )
    300300if (dylok) {
    301301  if (nsmod != NULL)  NSUnLinkModule(nsmod, NSUNLINKMODULE_OPTION_NONE);
     
    327327return f;
    328328#endif
    329 #if defined(Darwin)
     329#if defined(Darwin) && ( GCC_VERSION <= 3350 )
    330330string funame = "_" + funcname;
    331331NSSymbol nsf = NSLookupSymbolInModule(nsmod, funame.c_str());
  • trunk/SophyaLib/SysTools/pdlmgr.h

    r2496 r3605  
    1212#if defined(HPUX)
    1313#include <dl.h>
    14 #elif defined(Darwin)
     14/* Les fonction NSCreateObjectFile...() sont deprecated - Il faut utiliser les dlopen()...
     15   qui sont plus efficaces a partir de 10.4  - On se cale donc sur les versions de GCC */
     16#elif defined(Darwin) && ( GCC_VERSION <= 3350 )
    1517#include <mach-o/dyld.h>
    1618#else
     
    4749#if defined(HPUX)
    4850  shl_t dlhandle;
    49 #elif defined(Darwin)
     51#elif defined(Darwin) && ( GCC_VERSION <= 3350 )
    5052  NSObjectFileImage nsobjfile;
    5153  NSModule nsmod;
Note: See TracChangeset for help on using the changeset viewer.