1
0
mirror of https://github.com/simh/simh.git synced 2026-02-15 12:17:32 +00:00

PDP11, PDP10, AltairZ80: Fixed cases where assert() macro is called with an expression which has side effects and therefore wouldn't get executed if compiled with NDEBUG defined.

This commit is contained in:
Mark Pizzolato
2014-03-01 17:15:10 -08:00
parent 5217c6148b
commit a15858315a
6 changed files with 39 additions and 33 deletions

View File

@@ -743,6 +743,12 @@ typedef struct sim_bitfield BITFIELD;
#include "sim_timer.h"
#include "sim_fio.h"
/* Macro to ALWAYS execute the specified expression and fail if it evaluates to false. */
/* This replaces any references to "assert()" which should never be invoked */
/* with an expression which causes side effects (i.e. must be executed for */
/* the program to work correctly) */
#define ASSURE(_Expression) if (_Expression) {fprintf(stderr, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); abort();} else (void)0
/* Asynch/Threaded I/O support */
#if defined (SIM_ASYNCH_IO)