From 78f2f6d61707716da1700d2a46244d7301e434d6 Mon Sep 17 00:00:00 2001 From: josue Date: Fri, 12 Jun 2026 09:19:59 +0200 Subject: [PATCH] Rename lib/sysdep/os/osx to macos Rename the directory and the osx-prefixed files in it to match the modern platform name, and update the include guards and the references in source, premake and the cppcheck suppressions. Refs #7546 Co-Authored-By: Claude Fable 5 --- build/premake/premake5.lua | 2 +- source/lib/sysdep/os/{osx => macos}/dir_watch.cpp | 4 ++-- source/lib/sysdep/os/{osx/osx.cpp => macos/macos.cpp} | 4 ++-- .../sysdep/os/{osx/osx_atlas.h => macos/macos_atlas.h} | 8 ++++---- .../sysdep/os/{osx/osx_atlas.mm => macos/macos_atlas.mm} | 4 ++-- .../sysdep/os/{osx/osx_bundle.h => macos/macos_bundle.h} | 8 ++++---- .../os/{osx/osx_bundle.mm => macos/macos_bundle.mm} | 4 ++-- .../sysdep/os/{osx/osx_paths.h => macos/macos_paths.h} | 8 ++++---- .../sysdep/os/{osx/osx_paths.mm => macos/macos_paths.mm} | 4 ++-- .../{osx/osx_sys_version.h => macos/macos_sys_version.h} | 8 ++++---- .../osx_sys_version.mm => macos/macos_sys_version.mm} | 4 ++-- source/lib/sysdep/os/{osx => macos}/ocpu.cpp | 2 +- source/lib/sysdep/os/{osx => macos}/odbg.cpp | 2 +- source/main.cpp | 2 +- source/ps/DllLoader.cpp | 4 ++-- source/ps/GameSetup/Paths.cpp | 6 +++--- source/tools/lint/cppcheck/suppressions-list.txt | 2 +- 17 files changed, 38 insertions(+), 38 deletions(-) rename source/lib/sysdep/os/{osx => macos}/dir_watch.cpp (98%) rename source/lib/sysdep/os/{osx/osx.cpp => macos/macos.cpp} (97%) rename source/lib/sysdep/os/{osx/osx_atlas.h => macos/macos_atlas.h} (92%) rename source/lib/sysdep/os/{osx/osx_atlas.mm => macos/macos_atlas.mm} (97%) rename source/lib/sysdep/os/{osx/osx_bundle.h => macos/macos_bundle.h} (94%) rename source/lib/sysdep/os/{osx/osx_bundle.mm => macos/macos_bundle.mm} (97%) rename source/lib/sysdep/os/{osx/osx_paths.h => macos/macos_paths.h} (93%) rename source/lib/sysdep/os/{osx/osx_paths.mm => macos/macos_paths.mm} (97%) rename source/lib/sysdep/os/{osx/osx_sys_version.h => macos/macos_sys_version.h} (90%) rename source/lib/sysdep/os/{osx/osx_sys_version.mm => macos/macos_sys_version.mm} (97%) rename source/lib/sysdep/os/{osx => macos}/ocpu.cpp (98%) rename source/lib/sysdep/os/{osx => macos}/odbg.cpp (97%) diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua index dedc3713a2..d2ce20f529 100644 --- a/build/premake/premake5.lua +++ b/build/premake/premake5.lua @@ -1023,7 +1023,7 @@ function setup_all_libs () -- note: RC file must be added to main_exe project. -- note: don't add "lib/sysdep/os/win/aken.cpp" because that must be compiled with the DDK. windows = { "lib/sysdep/os/win", "lib/sysdep/os/win/wposix", "lib/sysdep/os/win/whrt" }, - macosx = { "lib/sysdep/os/osx", "lib/sysdep/os/unix" }, + macosx = { "lib/sysdep/os/macos", "lib/sysdep/os/unix" }, bsd = { "lib/sysdep/os/bsd", "lib/sysdep/os/unix", "lib/sysdep/os/unix/x" }, } for i,v in pairs(sysdep_dirs[os.target()]) do diff --git a/source/lib/sysdep/os/osx/dir_watch.cpp b/source/lib/sysdep/os/macos/dir_watch.cpp similarity index 98% rename from source/lib/sysdep/os/osx/dir_watch.cpp rename to source/lib/sysdep/os/macos/dir_watch.cpp index 47232e533b..2b13b2e6c9 100644 --- a/source/lib/sysdep/os/osx/dir_watch.cpp +++ b/source/lib/sysdep/os/macos/dir_watch.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 @@ -24,7 +24,7 @@ #include "lib/sysdep/dir_watch.h" #include "lib/file/file_system.h" -#include "osx_sys_version.h" +#include "macos_sys_version.h" #include "lib/os_path.h" #include "lib/file/file.h" diff --git a/source/lib/sysdep/os/osx/osx.cpp b/source/lib/sysdep/os/macos/macos.cpp similarity index 97% rename from source/lib/sysdep/os/osx/osx.cpp rename to source/lib/sysdep/os/macos/macos.cpp index 97359dd997..f19c9d547a 100644 --- a/source/lib/sysdep/os/osx/osx.cpp +++ b/source/lib/sysdep/os/macos/macos.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 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 @@ -25,7 +25,7 @@ #include "lib/lib.h" #include "lib/sysdep/sysdep.h" #include "lib/utf8.h" -#include "osx_bundle.h" +#include "macos_bundle.h" #include #include // MAC_OS_X_VERSION_MIN_REQUIRED diff --git a/source/lib/sysdep/os/osx/osx_atlas.h b/source/lib/sysdep/os/macos/macos_atlas.h similarity index 92% rename from source/lib/sysdep/os/osx/osx_atlas.h rename to source/lib/sysdep/os/macos/macos_atlas.h index 34193f6bad..61026fd299 100644 --- a/source/lib/sysdep/os/osx/osx_atlas.h +++ b/source/lib/sysdep/os/macos/macos_atlas.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 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 @@ -20,8 +20,8 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef OSX_ATLAS_H -#define OSX_ATLAS_H +#ifndef MACOS_ATLAS_H +#define MACOS_ATLAS_H #include @@ -33,4 +33,4 @@ class CStr8; */ void startNewAtlasProcess(const std::vector& mods); -#endif // OSX_ATLAS_H +#endif // MACOS_ATLAS_H diff --git a/source/lib/sysdep/os/osx/osx_atlas.mm b/source/lib/sysdep/os/macos/macos_atlas.mm similarity index 97% rename from source/lib/sysdep/os/osx/osx_atlas.mm rename to source/lib/sysdep/os/macos/macos_atlas.mm index 79f85fa802..41c4ee9233 100644 --- a/source/lib/sysdep/os/osx/osx_atlas.mm +++ b/source/lib/sysdep/os/macos/macos_atlas.mm @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 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 @@ -23,7 +23,7 @@ #import // MAC_OS_X_VERSION_MIN_REQUIRED #import -#import "osx_atlas.h" +#import "macos_atlas.h" #include "lib/types.h" #include "ps/CStr.h" diff --git a/source/lib/sysdep/os/osx/osx_bundle.h b/source/lib/sysdep/os/macos/macos_bundle.h similarity index 94% rename from source/lib/sysdep/os/osx/osx_bundle.h rename to source/lib/sysdep/os/macos/macos_bundle.h index 1f91e40c1d..0d3030be80 100644 --- a/source/lib/sysdep/os/osx/osx_bundle.h +++ b/source/lib/sysdep/os/macos/macos_bundle.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 @@ -20,8 +20,8 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef OSX_BUNDLE_H -#define OSX_BUNDLE_H +#ifndef MACOS_BUNDLE_H +#define MACOS_BUNDLE_H /** * @file @@ -60,4 +60,4 @@ std::string osx_GetBundleResourcesPath(); */ std::string osx_GetBundleFrameworksPath(); -#endif // OSX_BUNDLE_H +#endif // MACOS_BUNDLE_H diff --git a/source/lib/sysdep/os/osx/osx_bundle.mm b/source/lib/sysdep/os/macos/macos_bundle.mm similarity index 97% rename from source/lib/sysdep/os/osx/osx_bundle.mm rename to source/lib/sysdep/os/macos/macos_bundle.mm index ec10b17c5d..2e3890a1a5 100644 --- a/source/lib/sysdep/os/osx/osx_bundle.mm +++ b/source/lib/sysdep/os/macos/macos_bundle.mm @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 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 @@ -24,7 +24,7 @@ #import #import -#import "osx_bundle.h" +#import "macos_bundle.h" bool osx_IsAppBundleValid() { diff --git a/source/lib/sysdep/os/osx/osx_paths.h b/source/lib/sysdep/os/macos/macos_paths.h similarity index 93% rename from source/lib/sysdep/os/osx/osx_paths.h rename to source/lib/sysdep/os/macos/macos_paths.h index ac7d36d4bd..3d8e1920ec 100644 --- a/source/lib/sysdep/os/osx/osx_paths.h +++ b/source/lib/sysdep/os/macos/macos_paths.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 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 @@ -20,8 +20,8 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef OSX_PATHS_H -#define OSX_PATHS_H +#ifndef MACOS_PATHS_H +#define MACOS_PATHS_H /** * @file @@ -44,4 +44,4 @@ std::string osx_GetAppSupportPath(); */ std::string osx_GetCachesPath(); -#endif // OSX_PATHS_H +#endif // MACOS_PATHS_H diff --git a/source/lib/sysdep/os/osx/osx_paths.mm b/source/lib/sysdep/os/macos/macos_paths.mm similarity index 97% rename from source/lib/sysdep/os/osx/osx_paths.mm rename to source/lib/sysdep/os/macos/macos_paths.mm index c090e6b353..72f2faf4a9 100644 --- a/source/lib/sysdep/os/osx/osx_paths.mm +++ b/source/lib/sysdep/os/macos/macos_paths.mm @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 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 @@ -24,7 +24,7 @@ #import #import -#import "osx_paths.h" +#import "macos_paths.h" // Helper function static std::string getUserDirectoryPath(NSSearchPathDirectory directory) diff --git a/source/lib/sysdep/os/osx/osx_sys_version.h b/source/lib/sysdep/os/macos/macos_sys_version.h similarity index 90% rename from source/lib/sysdep/os/osx/osx_sys_version.h rename to source/lib/sysdep/os/macos/macos_sys_version.h index d15435503e..8150bc1b84 100644 --- a/source/lib/sysdep/os/osx/osx_sys_version.h +++ b/source/lib/sysdep/os/macos/macos_sys_version.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 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 @@ -20,9 +20,9 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef OSX_SYS_VERSION_H -#define OSX_SYS_VERSION_H +#ifndef MACOS_SYS_VERSION_H +#define MACOS_SYS_VERSION_H void GetSystemVersion( int &major, int &minor, int &bugfix ); -#endif //OSX_SYS_VERSION_H +#endif //MACOS_SYS_VERSION_H diff --git a/source/lib/sysdep/os/osx/osx_sys_version.mm b/source/lib/sysdep/os/macos/macos_sys_version.mm similarity index 97% rename from source/lib/sysdep/os/osx/osx_sys_version.mm rename to source/lib/sysdep/os/macos/macos_sys_version.mm index 337bd2d324..96ab1cf893 100644 --- a/source/lib/sysdep/os/osx/osx_sys_version.mm +++ b/source/lib/sysdep/os/macos/macos_sys_version.mm @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 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 @@ -25,7 +25,7 @@ #import #import -#import "osx_sys_version.h" +#import "macos_sys_version.h" void GetSystemVersion(int &major, int &minor, int &bugfix) { diff --git a/source/lib/sysdep/os/osx/ocpu.cpp b/source/lib/sysdep/os/macos/ocpu.cpp similarity index 98% rename from source/lib/sysdep/os/osx/ocpu.cpp rename to source/lib/sysdep/os/macos/ocpu.cpp index dabcf707f8..cfc92f44ec 100644 --- a/source/lib/sysdep/os/osx/ocpu.cpp +++ b/source/lib/sysdep/os/macos/ocpu.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 diff --git a/source/lib/sysdep/os/osx/odbg.cpp b/source/lib/sysdep/os/macos/odbg.cpp similarity index 97% rename from source/lib/sysdep/os/osx/odbg.cpp rename to source/lib/sysdep/os/macos/odbg.cpp index 583f8bb3c9..71e1c1b693 100644 --- a/source/lib/sysdep/os/osx/odbg.cpp +++ b/source/lib/sysdep/os/macos/odbg.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 diff --git a/source/main.cpp b/source/main.cpp index 67ce0d754a..c4091b8221 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -114,7 +114,7 @@ that of Atlas depending on commandline parameters. #endif // OS_UNIX #if OS_MACOSX -#include "lib/sysdep/os/osx/osx_atlas.h" +#include "lib/sysdep/os/macos/macos_atlas.h" #endif #if MSC_VERSION diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp index e31add123b..0e937fba22 100644 --- a/source/ps/DllLoader.cpp +++ b/source/ps/DllLoader.cpp @@ -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 @@ -30,7 +30,7 @@ #include #if OS_MACOSX -# include "lib/sysdep/os/osx/osx_bundle.h" +# include "lib/sysdep/os/macos/macos_bundle.h" #endif static void* const HANDLE_UNAVAILABLE = (void*)-1; diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp index 4a6927139f..0758042e11 100644 --- a/source/ps/GameSetup/Paths.cpp +++ b/source/ps/GameSetup/Paths.cpp @@ -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 @@ -37,8 +37,8 @@ #if OS_WIN # include "lib/sysdep/os/win/wutil.h" // wutil_*Path #elif OS_MACOSX -# include "lib/sysdep/os/osx/osx_paths.h" -# include "lib/sysdep/os/osx/osx_bundle.h" +# include "lib/sysdep/os/macos/macos_paths.h" +# include "lib/sysdep/os/macos/macos_bundle.h" #endif diff --git a/source/tools/lint/cppcheck/suppressions-list.txt b/source/tools/lint/cppcheck/suppressions-list.txt index 34f05f8d81..4b0fea6afb 100644 --- a/source/tools/lint/cppcheck/suppressions-list.txt +++ b/source/tools/lint/cppcheck/suppressions-list.txt @@ -38,7 +38,7 @@ nullPointer:source/lib/tests/test_secure_crt.h nullPointerArithmetic:source/lib/sysdep/os/win/wposix/wposix_internal.h nullPointerArithmetic:source/lib/sysdep/os/win/wposix/wpthread.cpp -nullPointerOutOfMemory:source/lib/sysdep/os/osx/dir_watch.cpp +nullPointerOutOfMemory:source/lib/sysdep/os/macos/dir_watch.cpp nullPointerOutOfMemory:source/lib/sysdep/smbios.cpp nullPointerOutOfMemory:source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp