From 3e166310b4fab72cbbf73e34de6a0b66ba6155ed Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 22 Sep 2022 14:55:00 -0700 Subject: Rewrite require macro so it can be used as an expression --- riscv/insn_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'riscv/insn_macros.h') diff --git a/riscv/insn_macros.h b/riscv/insn_macros.h index 2fdfced..8ec8f76 100644 --- a/riscv/insn_macros.h +++ b/riscv/insn_macros.h @@ -4,6 +4,6 @@ // These conflict with Boost headers so can't be included from insn_template.h #define P (*p) -#define require(x) do { if (unlikely(!(x))) throw trap_illegal_instruction(insn.bits()); } while (0) +#define require(x) (unlikely(!(x)) ? throw trap_illegal_instruction(insn.bits()) : (void) 0) #endif -- cgit v1.1