summarylogtreecommitdiffstats
path: root/gameclient.patch
blob: 5d1f87d116ce47cc8541c6c6a6680b1c7729bbda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From d1c6739e93a788b7ea9da7915642b2c8d6ab0656 Mon Sep 17 00:00:00 2001
From: Alexander Grund <alexander.grund@tu-dresden.de>
Date: Fri, 3 Feb 2023 16:30:09 +0100
Subject: [PATCH] Fix compatibility with Boost 1.74+

This has turned into an error in Boost 1.81
Fixes #1551
---
 external/libsiedler2                | 2 +-
 external/s25update                  | 2 +-
 libs/s25main/network/GameClient.cpp | 8 +++++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

--- a/libs/s25main/network/GameClient.cpp
+++ b/libs/s25main/network/GameClient.cpp
@@ -119,7 +119,13 @@ bool GameClient::HostGame(const CreateServerInfo& csi, const boost::filesystem::
     if(playedMapPath != map_path)
     {
         boost::system::error_code ignoredEc;
-        copy_file(map_path, playedMapPath, boost::filesystem::copy_option::overwrite_if_exists, ignoredEc);
+        constexpr auto overwrite_existing =
+#if BOOST_VERSION >= 107400
+          boost::filesystem::copy_options::overwrite_existing;
+#else
+          boost::filesystem::copy_option::overwrite_if_exists;
+#endif
+        copy_file(map_path, playedMapPath, overwrite_existing, ignoredEc);
     }
     return GAMESERVER.Start(csi, map_path, map_type, hostPw)
            && Connect("localhost", hostPw, csi.type, csi.port, true, csi.ipv6);