PDP11, PDP10, VAX, AltairZ80: enhanced the macro which aborts on an unexpected status from an expression with side effects to also write a message to sim_log or sim_deb if they happen to be open.

This commit is contained in:
Mark Pizzolato 2014-03-01 17:56:12 -08:00
parent a15858315a
commit 6b1dd7065f

View file

@ -747,7 +747,10 @@ typedef struct sim_bitfield BITFIELD;
/* This replaces any references to "assert()" which should never be invoked */ /* This replaces any references to "assert()" which should never be invoked */
/* with an expression which causes side effects (i.e. must be executed for */ /* with an expression which causes side effects (i.e. must be executed for */
/* the program to work correctly) */ /* 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 #define ASSURE(_Expression) if (_Expression) {fprintf(stderr, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); \
if (sim_log) fprintf(sim_log, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); \
if (sim_deb) fprintf(sim_deb, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); \
abort();} else (void)0
/* Asynch/Threaded I/O support */ /* Asynch/Threaded I/O support */