Add workaround for i686 where std::size_t is `unsigned int`

enumerated_bitset expects that typename `E` and `std::size_t` are
distinct types.  On some i686 targets, `std::size_t` is an alias for
`unsigned int`, so setting `E = uint32_t` causes `std::size_t` and `E`
to be the same type.

Add a workaround by using `unsigned int` or `unsigned long`, whichever
one `std::size_t` is not.  This will become unnecessary once
`playernum_t` becomes an `enum class`.

Reported-by: pkubaj <https://github.com/dxx-rebirth/dxx-rebirth/issues/662>
This commit is contained in:
Kp 2022-10-09 23:15:21 +00:00
parent cb8303839c
commit 2dd538eb4d
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ struct UDP_netgame_info_lite : public prohibit_void_ptr<UDP_netgame_info_lite>
bit_game_flags game_flag;
};
struct player_acknowledgement_mask : enumerated_bitset<MAX_PLAYERS, playernum_t>
struct player_acknowledgement_mask : enumerated_bitset<MAX_PLAYERS, std::conditional<std::is_same<std::size_t, unsigned>::value, unsigned long, playernum_t>::type>
{
public:
constexpr player_acknowledgement_mask() :