Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:58:23 PM (13 years ago)
Author:
rgrieder
Message:

Merged revisions 7978 - 8096 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/src/libraries/core/PathConfig.cc

    r6417 r8284  
    5959#if (BOOST_VERSION == 103600)
    6060#  define BOOST_LEAF_FUNCTION filename
    61 #else
     61#elif (BOOST_FILESYSTEM_VERSION < 3)
    6262#  define BOOST_LEAF_FUNCTION leaf
     63#else
     64#  define BOOST_LEAF_FUNCTION path().filename().string
    6365#endif
    6466
     
    9597#elif defined(ORXONOX_PLATFORM_APPLE)
    9698        char buffer[1024];
    97         unsigned long path_len = 1023;
     99        uint32_t path_len = 1023;
    98100        if (_NSGetExecutablePath(buffer, &path_len))
    99101            ThrowException(General, "Could not retrieve executable path.");
     
    125127#endif
    126128
    127         executablePath_ = bf::path(buffer);
    128 #ifndef ORXONOX_PLATFORM_APPLE
    129         executablePath_ = executablePath_.branch_path(); // remove executable name
    130 #endif
     129        // Remove executable filename
     130        executablePath_ = bf::path(buffer).branch_path();
    131131
    132132        /////////////////////
     
    206206
    207207            // Get user directory
    208 #  ifdef ORXONOX_PLATFORM_UNIX /* Apple? */
     208#ifdef ORXONOX_PLATFORM_UNIX
    209209            char* userDataPathPtr(getenv("HOME"));
    210 #  else
     210#else
    211211            char* userDataPathPtr(getenv("APPDATA"));
    212 #  endif
     212#endif
    213213            if (userDataPathPtr == NULL)
    214214                ThrowException(General, "Could not retrieve user data path.");
     
    233233        // Create directories to avoid problems when opening files in non existent folders.
    234234        std::vector<std::pair<bf::path, std::string> > directories;
    235         directories.push_back(std::make_pair(bf::path(configPath_), "config"));
    236         directories.push_back(std::make_pair(bf::path(logPath_), "log"));
     235        directories.push_back(std::make_pair(bf::path(configPath_), std::string("config")));
     236        directories.push_back(std::make_pair(bf::path(logPath_), std::string("log")));
    237237
    238238        for (std::vector<std::pair<bf::path, std::string> >::iterator it = directories.begin();
     
    273273        while (file != end)
    274274        {
    275             const std::string& filename = file->BOOST_LEAF_FUNCTION();
    276 
    277             // Check if the file ends with the exension in question
     275            std::string filename = file->BOOST_LEAF_FUNCTION();
     276
     277            // Check if the file ends with the extension in question
    278278            if (filename.size() > moduleextensionlength)
    279279            {
     
    282282                    // We've found a helper file
    283283                    const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);
     284#if BOOST_FILESYSTEM_VERSION < 3
    284285                    modulePaths.push_back((modulePath_ / library).file_string());
     286#else
     287                    modulePaths.push_back((modulePath_ / library).string());
     288#endif
    285289                }
    286290            }
Note: See TracChangeset for help on using the changeset viewer.