Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7513


Ignore:
Timestamp:
Oct 9, 2010, 12:27:50 AM (14 years ago)
Author:
rgrieder
Message:

Updated DynLib class to the newest version in the OGRE trunk.
This should hopefully make it compile on OS X.

Location:
code/branches/ois_update/src/libraries/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ois_update/src/libraries/core/DynLib.cc

    r6417 r7513  
    4242#endif
    4343
    44 #ifdef ORXONOX_PLATFORM_LINUX
     44#ifdef ORXONOX_PLATFORM_UNIX
    4545#  include <dlfcn.h>
    4646#endif
    4747
    4848#ifdef ORXONOX_PLATFORM_APPLE
    49 include <macPlugins.h>
     49 include <OSX/macUtils.h> // OGRE include
    5050#endif
    5151
     
    7575        if (name.substr(name.length() - 3, 3) != ".so")
    7676           name += ".so";
     77#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
     78        // dlopen() does not add .dylib to the filename, like windows does for .dll
     79        if (name.substr(name.length() - 6, 6) != ".dylib")
     80            name += ".dylib";
     81#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
     82        // Although LoadLibraryEx will add .dll itself when you only specify the library name,
     83        // if you include a relative path then it does not. So, add it to be sure.
     84        if (name.substr(name.length() - 4, 4) != ".dll")
     85            name += ".dll";
    7786#endif
    7887
     
    127136        LocalFree( lpMsgBuf );
    128137        return ret;
    129 #elif defined(ORXONOX_PLATFORM_LINUX)
     138#elif defined(ORXONOX_PLATFORM_UNIX)
    130139        return std::string(dlerror());
    131 #elif defined(ORXONOX_PLATFORM_APPLE)
    132         return std::string(mac_errorBundle());
    133140#else
    134141        return "";
  • code/branches/ois_update/src/libraries/core/DynLib.h

    r7512 r7513  
    5959
    6060#elif defined(ORXONOX_PLATFORM_APPLE)
    61 #    define DYNLIB_HANDLE CFBundleRef
    62 #    define DYNLIB_LOAD( a ) Ogre::mac_loadExeBundle( a )
    63 #    define DYNLIB_GETSYM( a, b ) Ogre::mac_getBundleSym( a, b )
    64 #    define DYNLIB_UNLOAD( a ) Ogre::mac_unloadExeBundle( a )
     61#    define DYNLIB_HANDLE void*
     62#    define DYNLIB_LOAD( a ) Ogre::mac_loadDylib( a )
     63#    define DYNLIB_GETSYM( a, b ) dlsym( a, b )
     64#    define DYNLIB_UNLOAD( a ) dlclose( a )
    6565#endif
    6666
Note: See TracChangeset for help on using the changeset viewer.