diff --git a/source/lib/sysdep/os/macos/macos.cpp b/source/lib/sysdep/os/macos/macos.cpp index f19c9d547a..1c174c55c1 100644 --- a/source/lib/sysdep/os/macos/macos.cpp +++ b/source/lib/sysdep/os/macos/macos.cpp @@ -42,9 +42,9 @@ OsPath sys_ExecutablePathname() // On OS X we might be a bundle, return the bundle path as the executable name, // i.e. /path/to/0ad.app instead of /path/to/0ad.app/Contents/MacOS/pyrogenesis - if (osx_IsAppBundleValid()) + if (macos_IsAppBundleValid()) { - path = osx_GetBundlePath(); + path = macos_GetBundlePath(); ENSURE(!path.empty()); } else diff --git a/source/lib/sysdep/os/macos/macos_bundle.h b/source/lib/sysdep/os/macos/macos_bundle.h index 0d3030be80..e712059be4 100644 --- a/source/lib/sysdep/os/macos/macos_bundle.h +++ b/source/lib/sysdep/os/macos/macos_bundle.h @@ -34,7 +34,7 @@ * @return true if valid bundle reference was found matching identifier * property "com.wildfiregames.play0ad" */ -bool osx_IsAppBundleValid(); +bool macos_IsAppBundleValid(); /** * Get the system path to the bundle itself @@ -42,7 +42,7 @@ bool osx_IsAppBundleValid(); * @return string containing POSIX-style path in UTF-8 encoding, * else empty string if an error occurred. */ -std::string osx_GetBundlePath(); +std::string macos_GetBundlePath(); /** * Get the system path to the bundle's Resources directory @@ -50,7 +50,7 @@ std::string osx_GetBundlePath(); * @return string containing POSIX-style path in UTF-8 encoding, * else empty string if an error occurred. */ -std::string osx_GetBundleResourcesPath(); +std::string macos_GetBundleResourcesPath(); /** * Get the system path to the bundle's Frameworks directory @@ -58,6 +58,6 @@ std::string osx_GetBundleResourcesPath(); * @return string containing POSIX-style path in UTF-8 encoding, * else empty string if an error occurred. */ -std::string osx_GetBundleFrameworksPath(); +std::string macos_GetBundleFrameworksPath(); #endif // MACOS_BUNDLE_H diff --git a/source/lib/sysdep/os/macos/macos_bundle.mm b/source/lib/sysdep/os/macos/macos_bundle.mm index 2e3890a1a5..807c3e6b69 100644 --- a/source/lib/sysdep/os/macos/macos_bundle.mm +++ b/source/lib/sysdep/os/macos/macos_bundle.mm @@ -26,7 +26,7 @@ #import "macos_bundle.h" -bool osx_IsAppBundleValid() +bool macos_IsAppBundleValid() { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -63,17 +63,17 @@ std::string GetBundlePath(SEL selector) } } -std::string osx_GetBundlePath() +std::string macos_GetBundlePath() { return GetBundlePath(@selector(bundleURL)); } -std::string osx_GetBundleResourcesPath() +std::string macos_GetBundleResourcesPath() { return GetBundlePath(@selector(resourceURL)); } -std::string osx_GetBundleFrameworksPath() +std::string macos_GetBundleFrameworksPath() { return GetBundlePath(@selector(privateFrameworksURL)); } diff --git a/source/lib/sysdep/os/macos/macos_paths.h b/source/lib/sysdep/os/macos/macos_paths.h index 3d8e1920ec..061e47833f 100644 --- a/source/lib/sysdep/os/macos/macos_paths.h +++ b/source/lib/sysdep/os/macos/macos_paths.h @@ -34,7 +34,7 @@ * @return string containing POSIX-style path in UTF-8 encoding, * else empty string if an error occurred. */ -std::string osx_GetAppSupportPath(); +std::string macos_GetAppSupportPath(); /** * Get the user's Caches path (typically ~/Library/Caches) @@ -42,6 +42,6 @@ std::string osx_GetAppSupportPath(); * @return string containing POSIX-style path in UTF-8 encoding, * else empty string if an error occurred. */ -std::string osx_GetCachesPath(); +std::string macos_GetCachesPath(); #endif // MACOS_PATHS_H diff --git a/source/lib/sysdep/os/macos/macos_paths.mm b/source/lib/sysdep/os/macos/macos_paths.mm index 72f2faf4a9..a8ddc88d3f 100644 --- a/source/lib/sysdep/os/macos/macos_paths.mm +++ b/source/lib/sysdep/os/macos/macos_paths.mm @@ -62,12 +62,12 @@ static std::string getUserDirectoryPath(NSSearchPathDirectory directory) return result; } -std::string osx_GetAppSupportPath() +std::string macos_GetAppSupportPath() { return getUserDirectoryPath(NSApplicationSupportDirectory); } -std::string osx_GetCachesPath() +std::string macos_GetCachesPath() { return getUserDirectoryPath(NSCachesDirectory); } diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp index e663989b0d..206ff2191f 100644 --- a/source/ps/DllLoader.cpp +++ b/source/ps/DllLoader.cpp @@ -83,12 +83,12 @@ CStr DllLoader::GenerateFilename(const CStr& name, const CStr& suffix, const CSt n = g_Libdir + "/"; #if OS_MACOS - if (osx_IsAppBundleValid()) + if (macos_IsAppBundleValid()) { // We are in a bundle, in which case the lib directory is ../Frameworks // relative to the binary, so we use a helper function to get the system path // (alternately we could use @executable_path as below, but this seems better) - CStr frameworksPath = osx_GetBundleFrameworksPath(); + CStr frameworksPath = macos_GetBundleFrameworksPath(); if (!frameworksPath.empty()) n = frameworksPath + "/"; } diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp index 2f3f130016..8dc4f437db 100644 --- a/source/ps/GameSetup/Paths.cpp +++ b/source/ps/GameSetup/Paths.cpp @@ -116,7 +116,7 @@ Paths::Paths(const CmdLineArgs& args) * regenerated if this directory is deleted. It is not * included in backups by default. * - * Note: the paths returned by osx_Get*Path are not guaranteed to exist, + * Note: the paths returned by macos_Get*Path are not guaranteed to exist, * but that's OK since we always create them on demand. */ @@ -127,12 +127,12 @@ Paths::Paths(const CmdLineArgs& args) OsPath cachePath; // ~/Library/Caches/0ad { - std::string path = osx_GetAppSupportPath(); + std::string path = macos_GetAppSupportPath(); ENSURE(!path.empty()); appSupportPath = OsPath(path) / subdirectoryName; } { - std::string path = osx_GetCachesPath(); + std::string path = macos_GetCachesPath(); ENSURE(!path.empty()); cachePath = OsPath(path) / subdirectoryName; } @@ -204,11 +204,11 @@ Paths::Paths(const CmdLineArgs& args) #else # if OS_MACOS - if (osx_IsAppBundleValid()) + if (macos_IsAppBundleValid()) { debug_printf("Valid app bundle detected\n"); - std::string resourcesPath = osx_GetBundleResourcesPath(); + std::string resourcesPath = macos_GetBundleResourcesPath(); // Ensure we have a valid resources path ENSURE(!resourcesPath.empty());