mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Get rid of the assert replacement. It prevents you from using assert in
a destructor for a literal type due to the implicit nothrow. It's just not worth the trouble it's causing. In file included from ../../../../../src/emu/emu.h:83: ../../../../../src/emu/mconfig.h:70:5: error: '~token' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions] assert(m_device == m_host.m_current_device); ^ In file included from ../../../../../src/emu/emu.h:29: ../../../../../src/emu/emucore.h:230:48: note: expanded from macro 'assert' #define assert(x) do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) ^ In file included from ../../../../../src/emu/emu.h:83: ../../../../../src/emu/mconfig.h:66:3: note: destructor has a implicit non-throwing exception specification ~token() ^ 1 error generated.
This commit is contained in:
parent
2047471723
commit
6487cd2e95
@ -220,17 +220,13 @@ inline TYPE &operator|=(TYPE &a, TYPE b) { return a = a | b; }
|
||||
|
||||
|
||||
// standard assertion macros
|
||||
#undef assert
|
||||
#undef assert_always
|
||||
|
||||
#if defined(MAME_DEBUG_FAST)
|
||||
#define assert(x) do { } while (0)
|
||||
#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
|
||||
#elif defined(MAME_DEBUG)
|
||||
#define assert(x) do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
|
||||
#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
|
||||
#else
|
||||
#define assert(x) do { } while (0)
|
||||
#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user