From 273be42cfd575e1822f09403a81ae233cbb311ac Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 12 Mar 2016 20:41:28 +0100 Subject: [PATCH] improve `ABORT' macro --- src/include/ngspice/macros.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/include/ngspice/macros.h b/src/include/ngspice/macros.h index d568cbd93..47d2886f6 100644 --- a/src/include/ngspice/macros.h +++ b/src/include/ngspice/macros.h @@ -39,7 +39,12 @@ #define SWAP(type, a, b) {type swapx; swapx = a; a = b; b = swapx;} -#define ABORT() fflush(stderr);fflush(stdout);abort(); +#define ABORT() \ + do { \ + fflush(stderr); \ + fflush(stdout); \ + abort(); \ + } while(0) #define MERROR(CODE, MESSAGE) \ do { \