From 9fc7a147777c8230e5667ee9f1fe2ebfb0088edb Mon Sep 17 00:00:00 2001 From: Kp Date: Mon, 1 Nov 2021 03:37:20 +0000 Subject: [PATCH] Fix LTO build of Descent 2 enum game_mode_flags must be visible in common code, which does not define DXX_BUILD_DESCENT_II. To avoid One Definition Rule errors, game_mode_flags must have the same definition in all files. Fortunately, the DXX_BUILD_DESCENT_II definition is a superset of the common definition, so the preprocessor guards can be replaced with advisory comments. Fixes: 2b718da343480629ca15f2fec285fd1964e689a4 ("Use enum class for Game_mode, Newdemo_game_mode") --- common/main/game.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/main/game.h b/common/main/game.h index 2f644d009..696b54312 100644 --- a/common/main/game.h +++ b/common/main/game.h @@ -85,10 +85,10 @@ enum class game_mode_flag : uint16_t unknown = 1u << 6, team = 1u << 8, bounty = 1u << 9, -#if defined(DXX_BUILD_DESCENT_II) + /* if DXX_BUILD_DESCENT_II */ capture = 1u << 10, hoard = 1u << 11, -#endif + /* endif */ }; enum class game_mode_flags : uint16_t @@ -99,11 +99,11 @@ enum class game_mode_flags : uint16_t anarchy_with_robots = static_cast(game_mode_flag::network) | static_cast(game_mode_flag::multi_robots), cooperative = static_cast(game_mode_flag::network) | static_cast(game_mode_flag::multi_robots) | static_cast(game_mode_flag::multi_coop), bounty = static_cast(game_mode_flag::network) | static_cast(game_mode_flag::bounty), -#if defined(DXX_BUILD_DESCENT_II) + /* if DXX_BUILD_DESCENT_II */ capture_flag = static_cast(game_mode_flag::network) | static_cast(game_mode_flag::team) | static_cast(game_mode_flag::capture), hoard = static_cast(game_mode_flag::network) | static_cast(game_mode_flag::hoard), team_hoard = static_cast(game_mode_flag::network) | static_cast(game_mode_flag::team) | static_cast(game_mode_flag::hoard), -#endif + /* endif */ }; // The following bits define the game modes.