From 57692561cd7a0ee97f30b5d1f2c5c16474e322f8 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Thu, 11 Oct 2018 11:44:15 +0100 Subject: [PATCH] Fix compile error on Linux with NO_USE_XINPUT=0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from /usr/include/X11/extensions/XInput.h:53:0, from ../../../../../src/osd/modules/input/input_x11.cpp:18: ../../../../../src/emu/save.h:95:32: error: expected unqualified-id before numeric constant static constexpr std::size_t COUNT = 1U; ^ ../../../../../src/emu/save.h:102:32: error: expected unqualified-id before numeric constant static constexpr std::size_t COUNT = N * array_unwrap::COUNT; ^ ../../../../../src/emu/save.h:109:32: error: expected unqualified-id before numeric constant static constexpr std::size_t COUNT = N * array_unwrap::COUNT; ^ ../../../../../src/emu/save.h: In member function ‘void save_manager::save_item(device_t*, const char*, const char*, int, ItemType&, const char*)’: ../../../../../src/emu/save.h:154:142: error: expected unqualified-id before numeric constant save_memory(device, module, tag, index, valname, array_unwrap::ptr(value), array_unwrap::SIZE, array_unwrap::COUNT); ^ ../../../../../src/emu/save.h: In member function ‘void save_manager::save_pointer(device_t*, const char*, const char*, int, ItemType*, const char*, u32)’: ../../../../../src/emu/save.h:163:145: error: expected unqualified-id before numeric constant save_memory(device, module, tag, index, valname, array_unwrap::ptr(value[0]), array_unwrap::SIZE, array_unwrap::COUNT * count); ^ ../../../../../src/emu/save.h: In member function ‘void save_manager::save_pointer(device_t*, const char*, const char*, int, std::unique_ptr<_Tp []>&, const char*, u32)’: ../../../../../src/emu/save.h:172:145: error: expected unqualified-id before numeric constant save_memory(device, module, tag, index, valname, array_unwrap::ptr(value[0]), array_unwrap::SIZE, array_unwrap::COUNT * count); --- src/emu/save.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/emu/save.h b/src/emu/save.h index 9097c195dec..cfdf119a156 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -92,21 +92,21 @@ class save_manager template struct array_unwrap { using underlying_type = T; - static constexpr std::size_t COUNT = 1U; + static constexpr std::size_t SAVE_COUNT = 1U; static constexpr std::size_t SIZE = sizeof(underlying_type); static underlying_type *ptr(T &value) { return &value; } }; template struct array_unwrap { using underlying_type = typename array_unwrap::underlying_type; - static constexpr std::size_t COUNT = N * array_unwrap::COUNT; + static constexpr std::size_t SAVE_COUNT = N * array_unwrap::SAVE_COUNT; static constexpr std::size_t SIZE = sizeof(underlying_type); static underlying_type *ptr(T (&value)[N]) { return array_unwrap::ptr(value[0]); } }; template struct array_unwrap > { using underlying_type = typename array_unwrap::underlying_type; - static constexpr std::size_t COUNT = N * array_unwrap::COUNT; + static constexpr std::size_t SAVE_COUNT = N * array_unwrap::SAVE_COUNT; static constexpr std::size_t SIZE = sizeof(underlying_type); static underlying_type *ptr(std::array &value) { return array_unwrap::ptr(value[0]); } }; @@ -151,7 +151,7 @@ public: throw emu_fatalerror("Called save_item on a pointer with no count!"); if (!type_checker::underlying_type>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!"); - save_memory(device, module, tag, index, valname, array_unwrap::ptr(value), array_unwrap::SIZE, array_unwrap::COUNT); + save_memory(device, module, tag, index, valname, array_unwrap::ptr(value), array_unwrap::SIZE, array_unwrap::SAVE_COUNT); } // templatized wrapper for pointers @@ -160,7 +160,7 @@ public: { if (!type_checker::underlying_type>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!"); - save_memory(device, module, tag, index, valname, array_unwrap::ptr(value[0]), array_unwrap::SIZE, array_unwrap::COUNT * count); + save_memory(device, module, tag, index, valname, array_unwrap::ptr(value[0]), array_unwrap::SIZE, array_unwrap::SAVE_COUNT * count); } // templatized wrapper for std::unique_ptr @@ -169,7 +169,7 @@ public: { if (!type_checker::underlying_type>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!"); - save_memory(device, module, tag, index, valname, array_unwrap::ptr(value[0]), array_unwrap::SIZE, array_unwrap::COUNT * count); + save_memory(device, module, tag, index, valname, array_unwrap::ptr(value[0]), array_unwrap::SIZE, array_unwrap::SAVE_COUNT * count); } // global memory registration