diff --git a/src/emu/emucore.h b/src/emu/emucore.h index c9b7900b010..c5d618d4355 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -27,6 +27,7 @@ #endif // standard C++ includes +#include #include #include #include @@ -254,10 +255,14 @@ template constexpr T bitswap(T val, U b, } // legacy names for backwards compatibility -template constexpr T BITSWAP8(T val, U... b) { return bitswap(val, b...); } -template constexpr T BITSWAP16(T val, U... b) { return bitswap(val, b...); } -template constexpr T BITSWAP24(T val, U... b) { return bitswap(val, b...); } -template constexpr T BITSWAP32(T val, U... b) { return bitswap(val, b...); } +template constexpr T BITSWAP8(T val, U... b) { static_assert(sizeof...(b) == 8U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP16(T val, U... b) { static_assert(sizeof...(b) == 16U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP24(T val, U... b) { static_assert(sizeof...(b) == 24U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP32(T val, U... b) { static_assert(sizeof...(b) == 32U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP40(T val, U... b) { static_assert(sizeof...(b) == 40U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP48(T val, U... b) { static_assert(sizeof...(b) == 48U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP56(T val, U... b) { static_assert(sizeof...(b) == 56U, "wrong number of bits"); return bitswap(val, b...); } +template constexpr T BITSWAP64(T val, U... b) { static_assert(sizeof...(b) == 64U, "wrong number of bits"); return bitswap(val, b...); }