Use the special asserts only for regression testing (nw)

This commit is contained in:
Olivier Galibert 2015-03-20 22:50:32 +01:00
parent d7d2628d60
commit ec7e08d074

View File

@ -214,6 +214,11 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); }
#define FUNC(x) &x, #x
#define FUNC_NULL NULL, "(null)"
#ifndef REGRESSION_TESTING
#define assert_always(x, msg) do { if (!(x)) { fprintf(stderr, "%s:%d: Assert failure: %s: %s\n", __FILE__, __LINE__, msg, #x); abort(); }} while (0)
#else
// standard assertion macros
#undef assert
@ -230,6 +235,8 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); }
#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
#endif
#endif
// macros to convert radians to degrees and degrees to radians
#define RADIAN_TO_DEGREE(x) ((180.0 / M_PI) * (x))