Rename the osx_ function prefix to macos_

Match the renamed macos_bundle and macos_paths files so the helpers no
longer carry the legacy OS X naming.

Refs #7546

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
josue 2026-06-12 09:23:58 +02:00
parent 16eb86c6b3
commit 69c4b7c3dd
7 changed files with 21 additions and 21 deletions

View file

@ -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

View file

@ -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

View file

@ -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));
}

View file

@ -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

View file

@ -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);
}

View file

@ -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 + "/";
}

View file

@ -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());