mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Rename the OS_MACOSX macro to OS_MACOS
The operating system was renamed from OS X to macOS in 2016; follow
suit, now that the legacy OS_MAC macro is gone (0d60ecbf96).
Refs #7546
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
78f2f6d617
commit
16eb86c6b3
17 changed files with 47 additions and 47 deletions
|
|
@ -34,7 +34,7 @@
|
|||
#if !CONFIG2_GLES
|
||||
# if OS_WIN
|
||||
# include <glad/wgl.h>
|
||||
# elif !OS_MACOSX
|
||||
# elif !OS_MACOS
|
||||
# include <SDL_config.h>
|
||||
# include <SDL_syswm.h>
|
||||
# if defined(SDL_VIDEO_DRIVER_X11)
|
||||
|
|
@ -216,7 +216,7 @@ bool ogl_HaveExtension(const char* ext)
|
|||
static int GLVersion;
|
||||
#if OS_WIN
|
||||
static int WGLVersion;
|
||||
#elif !CONFIG2_GLES && !OS_MACOSX
|
||||
#elif !CONFIG2_GLES && !OS_MACOS
|
||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||
static int GLXVersion;
|
||||
#endif
|
||||
|
|
@ -365,7 +365,7 @@ bool ogl_SquelchError(GLenum err_to_ignore)
|
|||
|
||||
#if OS_WIN
|
||||
bool ogl_Init(void* (load)(const char*), void* hdc)
|
||||
#elif !CONFIG2_GLES && !OS_MACOSX
|
||||
#elif !CONFIG2_GLES && !OS_MACOS
|
||||
bool ogl_Init(void* (load)(const char*), void* display, int subsystem)
|
||||
#else
|
||||
bool ogl_Init(void* (load)(const char*))
|
||||
|
|
@ -395,7 +395,7 @@ bool ogl_Init(void* (load)(const char*))
|
|||
LOAD_ERROR("Failed to load WGL functions.");
|
||||
return false;
|
||||
}
|
||||
# elif !OS_MACOSX
|
||||
# elif !OS_MACOS
|
||||
const SDL_SYSWM_TYPE sysWMType = static_cast<SDL_SYSWM_TYPE>(subsystem);
|
||||
# if defined(SDL_VIDEO_DRIVER_X11)
|
||||
if (sysWMType == SDL_SYSWM_X11)
|
||||
|
|
@ -457,7 +457,7 @@ void ogl_SetVsyncEnabled(bool enabled)
|
|||
#if !CONFIG2_GLES && OS_WIN
|
||||
if (ogl_HaveExtension("WGL_EXT_swap_control"))
|
||||
wglSwapIntervalEXT(interval);
|
||||
#elif !CONFIG2_GLES && !OS_MACOSX
|
||||
#elif !CONFIG2_GLES && !OS_MACOS
|
||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||
if (GLXVersion && ogl_HaveExtension("GLX_SGI_swap_control"))
|
||||
glXSwapIntervalSGI(interval);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2022 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
**/
|
||||
#if OS_WIN
|
||||
extern bool ogl_Init(void* (load)(const char*), void* hdc);
|
||||
#elif !OS_MACOSX && !CONFIG2_GLES
|
||||
#elif !OS_MACOS && !CONFIG2_GLES
|
||||
extern bool ogl_Init(void* (load)(const char*), void* display, int subsystem);
|
||||
#else
|
||||
extern bool ogl_Init(void* (load)(const char*));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -97,7 +97,7 @@ need only be renamed (e.g. _open, _stat).
|
|||
#include <strings.h> // IWYU pragma: export
|
||||
#endif
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
# define EMULATE_WCSDUP 1
|
||||
# define EMULATE_WCSCASECMP 1
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#include "lib/sysdep/cpu.h"
|
||||
#include "lib/sysdep/os.h"
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <sys/sysctl.h>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
const char* cpu_IdentifierString()
|
||||
{
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
size_t bufferSize = 0;
|
||||
|
||||
if (sysctlbyname("machdep.cpu.brand_string", nullptr, &bufferSize, nullptr, 0) != 0) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -62,9 +62,9 @@
|
|||
#endif
|
||||
// Mac OS X
|
||||
#if (defined(__APPLE__) && defined(__MACH__))
|
||||
# define OS_MACOSX 1
|
||||
# define OS_MACOS 1
|
||||
#else
|
||||
# define OS_MACOSX 0
|
||||
# define OS_MACOS 0
|
||||
#endif
|
||||
// BSD
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
|
||||
|
|
@ -107,13 +107,13 @@
|
|||
// convenience: additionally set OS_UNIX for Unix-based OSes
|
||||
// note: doing this in an separate section instead of adding the extra define
|
||||
// to all affected OSes saves a few undefs or macro redefinition warnings.
|
||||
#if OS_LINUX || OS_MACOSX || OS_BSD || OS_SOLARIS
|
||||
#if OS_LINUX || OS_MACOS || OS_BSD || OS_SOLARIS
|
||||
# undef OS_UNIX
|
||||
# define OS_UNIX 1
|
||||
#endif
|
||||
|
||||
// convenience: additionally set OS_BSD for BSD-based OSes. see note above.
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
# undef OS_BSD
|
||||
# define OS_BSD 1
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2025 Wildfire Games.
|
||||
/* Copyright (c) 2026 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include <sys/wait.h>
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
#define URL_OPEN_COMMAND "open"
|
||||
#else
|
||||
#define URL_OPEN_COMMAND "xdg-open"
|
||||
|
|
@ -69,7 +69,7 @@ void sys_display_msg(const wchar_t* caption, const wchar_t* msg)
|
|||
fprintf(stderr, "%ls: %ls\n", caption, msg); // must not use fwprintf, since stderr is byte-oriented
|
||||
}
|
||||
|
||||
#if OS_MACOSX || OS_ANDROID
|
||||
#if OS_MACOS || OS_ANDROID
|
||||
static ErrorReactionInternal try_gui_display_error(const wchar_t* /*text*/, bool /*manual_break*/,
|
||||
bool /*allow_suppress*/, bool /*no_continue*/)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
# define HAVE_GETTIMEOFDAY 0
|
||||
#endif
|
||||
|
||||
#if (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) || OS_MACOSX
|
||||
#if (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) || OS_MACOS
|
||||
# define HAVE_CLOCK_GETTIME 1
|
||||
#else
|
||||
# define HAVE_CLOCK_GETTIME 0
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ that of Atlas depending on commandline parameters.
|
|||
#include <unistd.h> // geteuid
|
||||
#endif // OS_UNIX
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
#include "lib/sysdep/os/macos/macos_atlas.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -808,7 +808,7 @@ static void RunGameOrAtlas(const std::span<const char* const> argv)
|
|||
if (rlInterfaceError)
|
||||
throw RL::SetupError{};
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
if (g_Shutdown == ShutdownType::RestartAsAtlas)
|
||||
startNewAtlasProcess(g_Mods.GetEnabledMods());
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
# include "lib/sysdep/os/macos/macos_bundle.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ static CStr suffixes[] = { "", "_dbg" };
|
|||
// NB: our Windows dlopen() function changes the extension to .dll
|
||||
static CStr extensions[] = {
|
||||
".so",
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
".dylib" // supported by OS X dlopen
|
||||
#endif
|
||||
};
|
||||
|
|
@ -82,7 +82,7 @@ CStr DllLoader::GenerateFilename(const CStr& name, const CStr& suffix, const CSt
|
|||
if (!g_Libdir.empty())
|
||||
n = g_Libdir + "/";
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
if (osx_IsAppBundleValid())
|
||||
{
|
||||
// We are in a bundle, in which case the lib directory is ../Frameworks
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
#include <utility>
|
||||
|
||||
|
||||
#if !(OS_WIN || OS_MACOSX || OS_ANDROID) // assume all other platforms use X11 for wxWidgets
|
||||
#if !(OS_WIN || OS_MACOS || OS_ANDROID) // assume all other platforms use X11 for wxWidgets
|
||||
#define MUST_INIT_X11 1
|
||||
#include <X11/Xlib.h>
|
||||
#else
|
||||
|
|
@ -337,7 +337,7 @@ static void InitSDL()
|
|||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1");
|
||||
#endif
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
// Some Mac mice only have one button, so they can't right-click
|
||||
// but SDL2 can emulate that with Ctrl+Click
|
||||
SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK,
|
||||
|
|
@ -434,7 +434,7 @@ void ShutdownConfigAndSubsequent()
|
|||
#if OS_UNIX
|
||||
static void FixLocales()
|
||||
{
|
||||
#if OS_MACOSX || OS_BSD
|
||||
#if OS_MACOS || OS_BSD
|
||||
// OS X requires a UTF-8 locale in LC_CTYPE so that *wprintf can handle
|
||||
// wide characters. Peculiarly the string "UTF-8" seems to be acceptable
|
||||
// despite not being a real locale, and it's conveniently language-agnostic,
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ void RunHardwareDetection(bool writeSystemInfoBeforeDetection, Renderer::Backend
|
|||
Script::SetProperty(rq, settings, "os_bsd", OS_BSD);
|
||||
Script::SetProperty(rq, settings, "os_linux", OS_LINUX);
|
||||
Script::SetProperty(rq, settings, "os_android", OS_ANDROID);
|
||||
Script::SetProperty(rq, settings, "os_macosx", OS_MACOSX);
|
||||
Script::SetProperty(rq, settings, "os_macosx", OS_MACOS);
|
||||
Script::SetProperty(rq, settings, "os_win", OS_WIN);
|
||||
|
||||
Script::SetProperty(rq, settings, "arch_ia32", ARCH_IA32);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#if OS_WIN
|
||||
# include "lib/sysdep/os/win/wutil.h" // wutil_*Path
|
||||
#elif OS_MACOSX
|
||||
#elif OS_MACOS
|
||||
# include "lib/sysdep/os/macos/macos_paths.h"
|
||||
# include "lib/sysdep/os/macos/macos_bundle.h"
|
||||
#endif
|
||||
|
|
@ -103,7 +103,7 @@ Paths::Paths(const CmdLineArgs& args)
|
|||
m_config = roamingAppData / "config"/"";
|
||||
m_logs = localAppdata / "logs"/"";
|
||||
|
||||
#elif OS_MACOSX
|
||||
#elif OS_MACOS
|
||||
|
||||
/* For reasoning behind our OS X paths, see the discussion here:
|
||||
* http://www.wildfiregames.com/forum/index.php?showtopic=15511
|
||||
|
|
@ -203,7 +203,7 @@ Paths::Paths(const CmdLineArgs& args)
|
|||
return OsPath(STRINGIZE(INSTALLED_DATADIR))/"";
|
||||
#else
|
||||
|
||||
# if OS_MACOSX
|
||||
# if OS_MACOS
|
||||
if (osx_IsAppBundleValid())
|
||||
{
|
||||
debug_printf("Valid app bundle detected\n");
|
||||
|
|
@ -214,7 +214,7 @@ Paths::Paths(const CmdLineArgs& args)
|
|||
|
||||
return OsPath(resourcesPath)/"data"/"";
|
||||
}
|
||||
# endif // OS_MACOSX
|
||||
# endif // OS_MACOS
|
||||
|
||||
return Root(argv0)/"data"/"";
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#if OS_MACOSX && SDL_VERSION_ATLEAST(2, 0, 6)
|
||||
#if OS_MACOS && SDL_VERSION_ATLEAST(2, 0, 6)
|
||||
#include "ps/DllLoader.h"
|
||||
|
||||
#include <SDL_vulkan.h>
|
||||
|
|
@ -393,7 +393,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
|||
flags |= SDL_WINDOW_VULKAN;
|
||||
m_WindowedX = m_WindowedY = SDL_WINDOWPOS_CENTERED_DISPLAY(m_ConfigDisplay);
|
||||
|
||||
#if OS_MACOSX && SDL_VERSION_ATLEAST(2, 0, 6)
|
||||
#if OS_MACOS && SDL_VERSION_ATLEAST(2, 0, 6)
|
||||
if (m_Backend == Renderer::Backend::Backend::VULKAN)
|
||||
{
|
||||
// MoltenVK - enable full component swizzling support.
|
||||
|
|
@ -710,7 +710,7 @@ void CVideoMode::RecreateSwapChain()
|
|||
|
||||
Renderer::Backend::ISwapChain* CVideoMode::GetOrCreateSwapChain()
|
||||
{
|
||||
#if !OS_MACOSX
|
||||
#if !OS_MACOS
|
||||
const bool vsync{g_ConfigDB.Get("vsync", false)};
|
||||
const bool vsyncChanged{m_ConfigVSync != vsync};
|
||||
if (vsyncChanged)
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
#if !OS_MACOSX
|
||||
#if !OS_MACOS
|
||||
auto hasDeviceExtension = [&extensions = choosenDevice.extensions](const char* name) -> bool
|
||||
{
|
||||
return std::find(extensions.begin(), extensions.end(), name) != extensions.end();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -45,13 +45,13 @@
|
|||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
#if OS_LINUX
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
#if OS_WIN || OS_WIN64 || OS_MACOSX
|
||||
#if OS_WIN || OS_WIN64 || OS_MACOS
|
||||
#include <filesystem>
|
||||
#endif
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ namespace
|
|||
{
|
||||
void ClearFromCache(const VfsPath& path)
|
||||
{
|
||||
#if OS_BSD && !OS_MACOSX
|
||||
#if OS_BSD && !OS_MACOS
|
||||
TS_SKIP("On BSD hotload isn't implemented.");
|
||||
#endif
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ void ClearFromCache(const VfsPath& path)
|
|||
PDirWatch dirWatch;
|
||||
dir_watch_Add((file.Parent() / "").string8(), dirWatch);
|
||||
|
||||
#if OS_WIN || OS_WIN64 || OS_MACOSX
|
||||
#if OS_WIN || OS_WIN64 || OS_MACOS
|
||||
std::filesystem::last_write_time(file.string8(), std::filesystem::file_time_type::clock::now());
|
||||
#endif
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ void ClearFromCache(const VfsPath& path)
|
|||
while (status == INFO::SKIPPED)
|
||||
{
|
||||
status = ReloadChangedFiles();
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
// Console apps don't have a run loop, so we need to wait
|
||||
// a bit for the file watcher to catch up.
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class MiscSetup : public CxxTest::GlobalFixture
|
|||
// Timer must be initialised, else things will break when tests do IO
|
||||
timer_Init();
|
||||
|
||||
#if OS_MACOSX || OS_BSD
|
||||
#if OS_MACOS || OS_BSD
|
||||
// See comment in GameSetup.cpp FixLocales
|
||||
setlocale(LC_CTYPE, "UTF-8");
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ MESSAGEHANDLER(ResizeScreen)
|
|||
{
|
||||
CVideoMode::UpdateRenderer(msg->width, msg->height);
|
||||
|
||||
#if OS_MACOSX
|
||||
#if OS_MACOS
|
||||
// OS X seems to require this to update the GL canvas
|
||||
Atlas_GLSetCurrent(const_cast<void*>(g_AtlasGameLoop->glCanvas));
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue