#endif
+//// Non-Windows
+#if !defined(_WIN32)
+
+const char *getHomeOrFail()
+{
+ const char *home = getenv("HOME");
+ // In rare cases the HOME environment variable may be unset
+ FATAL_ERROR_IF(!home,
+ "Required environment variable HOME is not set");
+ return home;
+}
+
+#endif
+
+
//// Windows
#if defined(_WIN32)
}
#ifndef __ANDROID__
- path_user = std::string(getenv("HOME")) + DIR_DELIM "."
+ path_user = std::string(getHomeOrFail()) + DIR_DELIM "."
+ PROJECT_NAME;
#endif
}
CFRelease(resources_url);
- path_user = std::string(getenv("HOME"))
+ path_user = std::string(getHomeOrFail())
+ "/Library/Application Support/"
+ PROJECT_NAME;
return true;
bool setSystemPaths()
{
path_share = STATIC_SHAREDIR;
- path_user = std::string(getenv("HOME")) + DIR_DELIM "."
+ path_user = std::string(getHomeOrFail()) + DIR_DELIM "."
+ lowercase(PROJECT_NAME);
return true;
}