diff options
Diffstat (limited to 'cord')
-rw-r--r-- | cord/cordprnt.c | 11 | ||||
-rw-r--r-- | cord/tests/de.c | 12 |
2 files changed, 19 insertions, 4 deletions
diff --git a/cord/cordprnt.c b/cord/cordprnt.c index 7eaf3723..70972af8 100644 --- a/cord/cordprnt.c +++ b/cord/cordprnt.c @@ -43,12 +43,19 @@ #define CONV_RESULT_LEN 50 /* Maximum length of any */ /* conversion with default */ /* width and prec. */ +#if defined(CPPCHECK) +# define MACRO_BLKSTMT_BEGIN { +# define MACRO_BLKSTMT_END } +#else +# define MACRO_BLKSTMT_BEGIN do { +# define MACRO_BLKSTMT_END } while (0) +#endif -#define OUT_OF_MEMORY do { \ +#define OUT_OF_MEMORY MACRO_BLKSTMT_BEGIN \ if (CORD_oom_fn != 0) (*CORD_oom_fn)(); \ fprintf(stderr, "Out of memory\n"); \ abort(); \ - } while (0) + MACRO_BLKSTMT_END static int ec_len(CORD_ec x) { diff --git a/cord/tests/de.c b/cord/tests/de.c index f69edde2..9f554d19 100644 --- a/cord/tests/de.c +++ b/cord/tests/de.c @@ -75,10 +75,18 @@ #endif #include "de_cmds.h" -#define OUT_OF_MEMORY do { \ +#if defined(CPPCHECK) +# define MACRO_BLKSTMT_BEGIN { +# define MACRO_BLKSTMT_END } +#else +# define MACRO_BLKSTMT_BEGIN do { +# define MACRO_BLKSTMT_END } while (0) +#endif + +#define OUT_OF_MEMORY MACRO_BLKSTMT_BEGIN \ fprintf(stderr, "Out of memory\n"); \ exit(3); \ - } while (0) + MACRO_BLKSTMT_END /* List of line number to position mappings, in descending order. */ /* There may be holes. */ |