From db8ea1459e3f2701817740697e2faab95b254d7e Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Tue, 3 Apr 2018 01:47:16 -0500 Subject: GCOMPAT__assert_with_reason: omit format parameter __VA_ARGS__ expects one or more arguments; this is a cheesy hack to allow passing only a format string (which is often all you need for small asserts). --- libgcompat/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgcompat/internal.h b/libgcompat/internal.h index bb107bc..3b08271 100644 --- a/libgcompat/internal.h +++ b/libgcompat/internal.h @@ -3,10 +3,10 @@ void GCOMPAT__panic(const char *fmt, ...) __attribute__((noreturn)); -#define GCOMPAT__assert_with_reason(chk, fmt, ...) \ +#define GCOMPAT__assert_with_reason(chk, ...) \ do { \ if (!(chk)) { \ - GCOMPAT__panic(fmt, __VA_ARGS__); \ + GCOMPAT__panic(__VA_ARGS__); \ } \ } \ while(0); -- cgit v1.2.3-70-g09d2