summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/emucore.h
diff options
context:
space:
mode:
author Oliver Stöneberg <oliverst@online.de>2015-03-20 12:19:40 +0100
committer Oliver Stöneberg <oliverst@online.de>2015-03-20 12:19:40 +0100
commitc61c31ee062f3df7881f938372a7a8a4993acdce (patch)
tree6ff13a1e74b0de95a41b770aa35b7e75eff50ea8 /src/emu/emucore.h
parent9f29fc0916ea0e39150572194fb99b0d45f77a7c (diff)
moved assert replacement inside emucore.h so it is actually used / removed assert.h include from some headers and added it to lots of source
Diffstat (limited to 'src/emu/emucore.h')
-rw-r--r--src/emu/emucore.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 23f8808a739..a9ca5b35ef9 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -31,6 +31,21 @@
#include <exception>
#include <typeinfo>
+// standard assertion macros
+#undef assert
+#undef assert_always
+
+#ifdef MAME_DEBUG_FAST
+#define assert(x) ((void)0)
+#define assert_always(x, msg) ((void)0)
+#elif 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
+
// core system includes
#include "osdcomm.h"
#include "astring.h"
@@ -214,19 +229,6 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); }
#define FUNC_NULL NULL, "(null)"
-// standard assertion macros
-#undef assert
-#undef assert_always
-
-#ifdef 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
-
-
// macros to convert radians to degrees and degrees to radians
#define RADIAN_TO_DEGREE(x) ((180.0 / M_PI) * (x))
#define DEGREE_TO_RADIAN(x) ((M_PI / 180.0) * (x))