summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorj4ck.fr0st <j4ck.fr0st@gmail.com>2010-01-29 19:45:01 +0000
committerj4ck.fr0st <j4ck.fr0st@gmail.com>2010-01-29 19:45:01 +0000
commite282d5c7f2a2b898bd2f4bf42efcbce827068c8d (patch)
treeccd7a7d36d1900a8483a73e44f4fb3bac2eb25c7 /Source/Core/Common
parent8b129fca0c23ce83172a01db143abae171bdd4c3 (diff)
Fixes Issue 2176 (SysConf on OSX), plus some initialization order warning fix in VolumeDirectory.cpp
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4985 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp13
-rw-r--r--Source/Core/Common/Src/FileUtil.h3
-rw-r--r--Source/Core/Common/Src/SysConf.cpp4
3 files changed, 17 insertions, 3 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index 5cff7cc55c..86eada6035 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -512,14 +512,23 @@ bool SetCurrentDir(const char *_rDirectory)
#if defined(__APPLE__)
//get the full config dir
-char *GetConfigDirectory()
+const char *GetConfigDirectory()
{
-
static char path[MAX_PATH] = {0};
if (strlen(path) > 0)
return path;
snprintf(path, sizeof(path), "%s" DIR_SEP CONFIG_FILE, GetUserDirectory());
return path;
+}
+
+//get the full SYSCONF dir
+const char *GetSysConfDirectory()
+{
+ static char path[MAX_PATH] = {0};
+ if (strlen(path) > 0)
+ return path;
+ snprintf(path, sizeof(path), "%s" DIR_SEP WII_SYSCONF_FILE, GetUserDirectory());
+ return path;
}
diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h
index c4a4abd2a7..728ad46f8a 100644
--- a/Source/Core/Common/Src/FileUtil.h
+++ b/Source/Core/Common/Src/FileUtil.h
@@ -94,7 +94,8 @@ std::string GetSysDirectory();
#ifdef __APPLE__
-char *GetConfigDirectory();
+const char *GetConfigDirectory();
+const char *GetSysConfDirectory();
std::string GetBundleDirectory();
#endif
diff --git a/Source/Core/Common/Src/SysConf.cpp b/Source/Core/Common/Src/SysConf.cpp
index 38c4f6f549..13fb688a0d 100644
--- a/Source/Core/Common/Src/SysConf.cpp
+++ b/Source/Core/Common/Src/SysConf.cpp
@@ -21,7 +21,11 @@
SysConf::SysConf()
: m_IsValid(false)
{
+#if defined(__APPLE__)
+ if (LoadFromFile(File::GetSysConfDirectory()))
+#else
if (LoadFromFile(WII_SYSCONF_FILE))
+#endif
m_IsValid = true;
}