diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index aaf6b71c25..b6f26af5b0 100644 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.cpp @@ -34,7 +34,7 @@ #if !CONFIG2_GLES # if OS_WIN # include -# elif !OS_MACOSX +# elif !OS_MACOS # include # include # 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(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); diff --git a/source/lib/ogl.h b/source/lib/ogl.h index a05c71ab59..5d894f204e 100644 --- a/source/lib/ogl.h +++ b/source/lib/ogl.h @@ -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*)); diff --git a/source/lib/posix/posix.h b/source/lib/posix/posix.h index 30ff15e5c1..ca11bb9ffd 100644 --- a/source/lib/posix/posix.h +++ b/source/lib/posix/posix.h @@ -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 // IWYU pragma: export #endif -#if OS_MACOSX +#if OS_MACOS # define EMULATE_WCSDUP 1 # define EMULATE_WCSCASECMP 1 #else diff --git a/source/lib/sysdep/arch/aarch64/aarch64.cpp b/source/lib/sysdep/arch/aarch64/aarch64.cpp index a775489168..11251fe72b 100644 --- a/source/lib/sysdep/arch/aarch64/aarch64.cpp +++ b/source/lib/sysdep/arch/aarch64/aarch64.cpp @@ -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 #include #include @@ -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) { diff --git a/source/lib/sysdep/os.h b/source/lib/sysdep/os.h index 9a3ae14777..8f47fd1139 100644 --- a/source/lib/sysdep/os.h +++ b/source/lib/sysdep/os.h @@ -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 diff --git a/source/lib/sysdep/os/unix/unix.cpp b/source/lib/sysdep/os/unix/unix.cpp index 347aa666d4..6870c3efa0 100644 --- a/source/lib/sysdep/os/unix/unix.cpp +++ b/source/lib/sysdep/os/unix/unix.cpp @@ -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 -#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*/) { diff --git a/source/lib/timer.cpp b/source/lib/timer.cpp index 023f646d98..179791c5e6 100644 --- a/source/lib/timer.cpp +++ b/source/lib/timer.cpp @@ -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 diff --git a/source/main.cpp b/source/main.cpp index c4091b8221..5e1dd5a890 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -113,7 +113,7 @@ that of Atlas depending on commandline parameters. #include // 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 argv) if (rlInterfaceError) throw RL::SetupError{}; -#if OS_MACOSX +#if OS_MACOS if (g_Shutdown == ShutdownType::RestartAsAtlas) startNewAtlasProcess(g_Mods.GetEnabledMods()); #else diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp index 0e937fba22..e663989b0d 100644 --- a/source/ps/DllLoader.cpp +++ b/source/ps/DllLoader.cpp @@ -29,7 +29,7 @@ #include #include -#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 diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 1aeff9e619..a7ed02d0fd 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -123,7 +123,7 @@ #include -#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 #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, diff --git a/source/ps/GameSetup/HWDetect.cpp b/source/ps/GameSetup/HWDetect.cpp index 0b61dcb6af..56089d6870 100644 --- a/source/ps/GameSetup/HWDetect.cpp +++ b/source/ps/GameSetup/HWDetect.cpp @@ -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); diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp index 0758042e11..2f3f130016 100644 --- a/source/ps/GameSetup/Paths.cpp +++ b/source/ps/GameSetup/Paths.cpp @@ -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"/""; diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index d676e4adb0..1f2ce6a9cb 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -63,7 +63,7 @@ #include #include -#if OS_MACOSX && SDL_VERSION_ATLEAST(2, 0, 6) +#if OS_MACOS && SDL_VERSION_ATLEAST(2, 0, 6) #include "ps/DllLoader.h" #include @@ -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) diff --git a/source/renderer/backend/vulkan/Device.cpp b/source/renderer/backend/vulkan/Device.cpp index 00e3ee21f2..91701f3409 100644 --- a/source/renderer/backend/vulkan/Device.cpp +++ b/source/renderer/backend/vulkan/Device.cpp @@ -437,7 +437,7 @@ std::unique_ptr 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(); diff --git a/source/scriptinterface/tests/test_Module.h b/source/scriptinterface/tests/test_Module.h index e3b0b1b3fb..aa77bb6e31 100644 --- a/source/scriptinterface/tests/test_Module.h +++ b/source/scriptinterface/tests/test_Module.h @@ -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 #include -#if OS_MACOSX +#if OS_MACOS #include #endif #if OS_LINUX #include #endif -#if OS_WIN || OS_WIN64 || OS_MACOSX +#if OS_WIN || OS_WIN64 || OS_MACOS #include #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); diff --git a/source/test_setup.cpp b/source/test_setup.cpp index c12e5f1973..4cf9fb0c93 100644 --- a/source/test_setup.cpp +++ b/source/test_setup.cpp @@ -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 diff --git a/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp index fb2c9b67c2..dc000f1b73 100644 --- a/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp @@ -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(g_AtlasGameLoop->glCanvas)); #endif