From d8817417cc099bdf47605a676067a8cf4f95bf23 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 23 Nov 2021 15:59:52 -0500 Subject: [PATCH] use compiler extension instead of C11 noreturn C11 noreturn isn't available in C++. --- new.cc | 2 -- util.h | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/new.cc b/new.cc index 451f2e5..e46e302 100644 --- a/new.cc +++ b/new.cc @@ -1,8 +1,6 @@ #include #include -#define noreturn - #include "h_malloc.h" #include "util.h" diff --git a/util.h b/util.h index f22ece5..3c7a428 100644 --- a/util.h +++ b/util.h @@ -2,7 +2,9 @@ #define UTIL_H #include -#include + +// C11 noreturn doesn't work in C++ +#define noreturn __attribute__((noreturn)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0)