summaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-04-06 15:12:04 +0200
committersapier <Sapier at GMX dot net>2014-04-19 11:56:19 +0200
commiteda9214f81b32d9606f425e3777616e8cfc0a44f (patch)
tree4c526f45edea82d4ddd205b975d600401873295c /src/porting.cpp
parenta230e1e7360eb561429bf69ad8793745fbd5e7c3 (diff)
downloadminetest-eda9214f81b32d9606f425e3777616e8cfc0a44f.tar.gz
minetest-eda9214f81b32d9606f425e3777616e8cfc0a44f.tar.bz2
minetest-eda9214f81b32d9606f425e3777616e8cfc0a44f.zip
Bunch of small fixes (coding style, very unlikely errors, warning messages)
Diffstat (limited to 'src/porting.cpp')
-rw-r--r--src/porting.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index e7bef1d33..53b3a3784 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -191,7 +191,7 @@ bool threadBindToProcessor(threadid_t tid, int pnumber) {
#elif defined(__sun) || defined(sun)
- return processor_bind(P_LWPID, MAKE_LWPID_PTHREAD(tid),
+ return processor_bind(P_LWPID, MAKE_LWPID_PTHREAD(tid),
pnumber, NULL) == 0;
#elif defined(_AIX)
@@ -477,7 +477,7 @@ void initializePaths()
i != trylist.end(); i++)
{
const std::string &trypath = *i;
- if(!fs::PathExists(trypath) || !fs::PathExists(trypath + "/builtin")){
+ if(!fs::PathExists(trypath) || !fs::PathExists(trypath + DIR_DELIM + "builtin")){
dstream<<"WARNING: system-wide share not found at \""
<<trypath<<"\""<<std::endl;
continue;
@@ -491,37 +491,37 @@ void initializePaths()
break;
}
- path_user = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
+ path_user = std::string(getenv("HOME")) + DIR_DELIM + "." + PROJECT_NAME;
/*
OS X
*/
#elif defined(__APPLE__)
- // Code based on
- // http://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c
- CFBundleRef main_bundle = CFBundleGetMainBundle();
- CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(main_bundle);
- char path[PATH_MAX];
- if(CFURLGetFileSystemRepresentation(resources_url, TRUE, (UInt8 *)path, PATH_MAX))
+ // Code based on
+ // http://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c
+ CFBundleRef main_bundle = CFBundleGetMainBundle();
+ CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(main_bundle);
+ char path[PATH_MAX];
+ if(CFURLGetFileSystemRepresentation(resources_url, TRUE, (UInt8 *)path, PATH_MAX))
{
dstream<<"Bundle resource path: "<<path<<std::endl;
//chdir(path);
- path_share = std::string(path) + "/share";
+ path_share = std::string(path) + DIR_DELIM + "share";
}
else
- {
- // error!
+ {
+ // error!
dstream<<"WARNING: Could not determine bundle resource path"<<std::endl;
- }
- CFRelease(resources_url);
+ }
+ CFRelease(resources_url);
path_user = std::string(getenv("HOME")) + "/Library/Application Support/" + PROJECT_NAME;
#else // FreeBSD, and probably many other POSIX-like systems.
path_share = STATIC_SHAREDIR;
- path_user = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
+ path_user = std::string(getenv("HOME")) + DIR_DELIM + "." + PROJECT_NAME;
#endif