Changeset 8284 for code/branches/kicklib2/src/libraries/core/PathConfig.cc
- Timestamp:
- Apr 21, 2011, 6:58:23 PM (13 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
-
code/branches/kicklib2/src/libraries/core/PathConfig.cc
r6417 r8284 59 59 #if (BOOST_VERSION == 103600) 60 60 # define BOOST_LEAF_FUNCTION filename 61 #el se61 #elif (BOOST_FILESYSTEM_VERSION < 3) 62 62 # define BOOST_LEAF_FUNCTION leaf 63 #else 64 # define BOOST_LEAF_FUNCTION path().filename().string 63 65 #endif 64 66 … … 95 97 #elif defined(ORXONOX_PLATFORM_APPLE) 96 98 char buffer[1024]; 97 u nsigned longpath_len = 1023;99 uint32_t path_len = 1023; 98 100 if (_NSGetExecutablePath(buffer, &path_len)) 99 101 ThrowException(General, "Could not retrieve executable path."); … … 125 127 #endif 126 128 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(); 131 131 132 132 ///////////////////// … … 206 206 207 207 // Get user directory 208 # ifdef ORXONOX_PLATFORM_UNIX /* Apple? */208 #ifdef ORXONOX_PLATFORM_UNIX 209 209 char* userDataPathPtr(getenv("HOME")); 210 # 210 #else 211 211 char* userDataPathPtr(getenv("APPDATA")); 212 # 212 #endif 213 213 if (userDataPathPtr == NULL) 214 214 ThrowException(General, "Could not retrieve user data path."); … … 233 233 // Create directories to avoid problems when opening files in non existent folders. 234 234 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"))); 237 237 238 238 for (std::vector<std::pair<bf::path, std::string> >::iterator it = directories.begin(); … … 273 273 while (file != end) 274 274 { 275 const std::string&filename = file->BOOST_LEAF_FUNCTION();276 277 // Check if the file ends with the ex ension in question275 std::string filename = file->BOOST_LEAF_FUNCTION(); 276 277 // Check if the file ends with the extension in question 278 278 if (filename.size() > moduleextensionlength) 279 279 { … … 282 282 // We've found a helper file 283 283 const std::string& library = filename.substr(0, filename.size() - moduleextensionlength); 284 #if BOOST_FILESYSTEM_VERSION < 3 284 285 modulePaths.push_back((modulePath_ / library).file_string()); 286 #else 287 modulePaths.push_back((modulePath_ / library).string()); 288 #endif 285 289 } 286 290 }
Note: See TracChangeset
for help on using the changeset viewer.