diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp index fc3fc25ef8..389eebc04b 100644 --- a/source/graphics/TextureManager.cpp +++ b/source/graphics/TextureManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -792,11 +792,11 @@ public: */ CTextureConverter::Settings GetConverterSettings(const CTexturePtr& texture) { - fs::wpath srcPath = texture->m_Properties.m_Path.string(); + boost::filesystem::path srcPath = texture->m_Properties.m_Path.string(); std::vector files; VfsPath p; - for (fs::wpath::iterator it = srcPath.begin(); it != srcPath.end(); ++it) + for (boost::filesystem::path::iterator it = srcPath.begin(); it != srcPath.end(); ++it) { VfsPath settingsPath = p / "textures.xml"; m_HotloadFiles[settingsPath].insert(texture); diff --git a/source/lib/external_libraries/suppress_boost_warnings.h b/source/lib/external_libraries/suppress_boost_warnings.h deleted file mode 100644 index e75e755f5f..0000000000 --- a/source/lib/external_libraries/suppress_boost_warnings.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 2025 Wildfire Games. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -// rationale: boost is only included from the PCH, but warnings are still -// raised when templates are instantiated (e.g. vfs_lookup.cpp), -// so include this header from such source files as well. - -#include "lib/sysdep/compiler.h" // MSC_VERSION -#include "lib/sysdep/arch.h" // ARCH_IA32 - -#if MSC_VERSION -# pragma warning(disable:4710) // function not inlined -# pragma warning(disable:4626) // assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted -# pragma warning(disable:4625) // copy constructor was implicitly defined as deleted -# pragma warning(disable:4668) // 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' -# pragma warning(disable:5027) // 'type': move assignment operator was implicitly defined as deleted -# pragma warning(disable:4365) // signed/unsigned mismatch -# pragma warning(disable:4619) // there is no warning for 'warning' -# pragma warning(disable:5031) // #pragma warning(pop): likely mismatch, popping warning state pushed in different file -# pragma warning(disable:5026) // 'type': move constructor was implicitly defined as deleted -# pragma warning(disable:4820) // incorrect padding -# pragma warning(disable:4514) // unreferenced inlined function has been removed -# pragma warning(disable:4571) // Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught -#endif diff --git a/source/lib/file/file_system.cpp b/source/lib/file/file_system.cpp index 2b1fdba056..e095eab0eb 100644 --- a/source/lib/file/file_system.cpp +++ b/source/lib/file/file_system.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -210,9 +210,9 @@ Status RenameFile(const OsPath& path, const OsPath& newPath) try { - fs::rename(fs::path(path.string()), fs::path(newPath.string())); + boost::filesystem::rename(boost::filesystem::path(path.string()), boost::filesystem::path(newPath.string())); } - catch (fs::filesystem_error& err) + catch (boost::filesystem::filesystem_error& err) { debug_printf("RenameFile: failed to rename %s to %s.\n%s\n", path.string8().c_str(), path.string8().c_str(), err.what()); return ERR::EXCEPTION; @@ -231,14 +231,14 @@ Status CopyFile(const OsPath& path, const OsPath& newPath, bool override_if_exis { if(override_if_exists) #if BOOST_VERSION >=107400 - fs::copy_file(fs::path(path.string()), fs::path(newPath.string()), boost::filesystem::copy_options::overwrite_existing); + boost::filesystem::copy_file(boost::filesystem::path(path.string()), boost::filesystem::path(newPath.string()), boost::filesystem::copy_options::overwrite_existing); #else - fs::copy_file(fs::path(path.string()), fs::path(newPath.string()), boost::filesystem::copy_option::overwrite_if_exists); + boost::filesystem::copy_file(boost::filesystem::path(path.string()), boost::filesystem::path(newPath.string()), boost::filesystem::copy_option::overwrite_if_exists); #endif else - fs::copy_file(fs::path(path.string()), fs::path(newPath.string())); + boost::filesystem::copy_file(boost::filesystem::path(path.string()), boost::filesystem::path(newPath.string())); } - catch(fs::filesystem_error& err) + catch(boost::filesystem::filesystem_error& err) { debug_printf("CopyFile: failed to copy %s to %s.\n%s\n", path.string8().c_str(), path.string8().c_str(), err.what()); return ERR::EXCEPTION; diff --git a/source/lib/file/vfs/vfs_lookup.cpp b/source/lib/file/vfs/vfs_lookup.cpp index 7562f0ce88..fb7668a54d 100644 --- a/source/lib/file/vfs/vfs_lookup.cpp +++ b/source/lib/file/vfs/vfs_lookup.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,10 +25,8 @@ */ #include "precompiled.h" + #include "lib/file/vfs/vfs_lookup.h" - -#include "lib/external_libraries/suppress_boost_warnings.h" - #include "lib/sysdep/filesystem.h" #include "lib/file/file.h" #include "lib/file/vfs/vfs.h" // error codes diff --git a/source/lib/pch/pch_boost.h b/source/lib/pch/pch_boost.h deleted file mode 100644 index 846fe05380..0000000000 --- a/source/lib/pch/pch_boost.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2022 Wildfire Games. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef INCLUDED_PCH_BOOST -#define INCLUDED_PCH_BOOST - -#include "lib/external_libraries/suppress_boost_warnings.h" - -#if MSC_VERSION -# define BOOST_HAS_STDINT_H -#endif - -// don't compile get_system_category() etc, since we don't use them and they -// sometimes cause problems when linking. -// But Filesystem <= 1.43 requires boost::system::posix, so only disable if newer -#include -#if BOOST_VERSION >= 104400 -# define BOOST_SYSTEM_NO_DEPRECATED -#endif - -// the following boost libraries have been included in TR1 and are -// thus deemed usable: -#if BOOST_VERSION >= 104400 -// Filesystem v3 is included since Boost 1.44 -// v2 is deprecated since 1.46 and removed entirely in 1.50 -# define BOOST_FILESYSTEM_VERSION 3 -#else -# define BOOST_FILESYSTEM_VERSION 2 -#endif - -namespace boost{ - namespace filesystem { - class path; - typedef path wpath; - }; -} -namespace fs = boost::filesystem; - -#endif // #ifndef INCLUDED_PCH_BOOST diff --git a/source/lib/precompiled.h b/source/lib/precompiled.h index c889a8e4cf..c6f132842e 100644 --- a/source/lib/precompiled.h +++ b/source/lib/precompiled.h @@ -69,8 +69,6 @@ #include "lib/lib.h" #include "lib/secure_crt.h" -#include "lib/pch/pch_boost.h" - #include #include diff --git a/source/ps/Filesystem.cpp b/source/ps/Filesystem.cpp index bc60c5bb19..7afc210014 100644 --- a/source/ps/Filesystem.cpp +++ b/source/ps/Filesystem.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -97,7 +97,7 @@ Status ReloadChangedFiles() return INFO::OK; } -std::wstring GetWstringFromWpath(const fs::wpath& path) +std::wstring GetWstringFromWpath(const boost::filesystem::path& path) { #if BOOST_FILESYSTEM_VERSION == 3 return path.wstring(); diff --git a/source/ps/Filesystem.h b/source/ps/Filesystem.h index bd89fd6430..6938b12de6 100644 --- a/source/ps/Filesystem.h +++ b/source/ps/Filesystem.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,8 @@ #include "ps/CStrForward.h" #include "ps/Errors.h" +#include + extern PIVFS g_VFS; extern bool VfsFileExists(const VfsPath& pathname); @@ -57,7 +59,7 @@ extern Status ReloadChangedFiles(); /** * Helper function to handle API differences between Boost Filesystem v2 and v3 */ -std::wstring GetWstringFromWpath(const fs::wpath& path); +std::wstring GetWstringFromWpath(const boost::filesystem::path& path); ERROR_GROUP(CVFSFile); ERROR_TYPE(CVFSFile, LoadFailed); diff --git a/source/simulation2/components/ICmpAIManager.cpp b/source/simulation2/components/ICmpAIManager.cpp index f6b57c35f6..434d17e5ad 100644 --- a/source/simulation2/components/ICmpAIManager.cpp +++ b/source/simulation2/components/ICmpAIManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -60,8 +60,8 @@ public: ScriptRequest rq(self->m_ScriptInterface); // Extract the 3rd component of the path (i.e. the directory after simulation/ai/) - fs::wpath components = pathname.string(); - fs::wpath::iterator it = components.begin(); + boost::filesystem::path components = pathname.string(); + boost::filesystem::path::iterator it = components.begin(); std::advance(it, 2); std::wstring dirname = GetWstringFromWpath(*it);