From c0f60b582f70f339c8f342a71efaa323a8039d3b Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 29 Jan 2017 17:02:34 +0100 Subject: [PATCH 1/5] Move statement expression detection to existing language-specific block --- chicken.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/chicken.h b/chicken.h index f3f16eb..fb3c6cd 100644 --- a/chicken.h +++ b/chicken.h @@ -219,16 +219,12 @@ void *alloca (); # endif #endif -/* Language specifics: */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#define HAVE_STATEMENT_EXPRESSIONS 1 -#endif - #if !defined(__clang__) && !defined(__has_attribute) /* Define so it won't error on other compilers with keywords like "noreturn" */ #define __has_attribute(x) 0 #endif +/* Language specifics: */ #if defined(__GNUC__) || defined(__INTEL_COMPILER) # define C_unlikely(x) __builtin_expect((x), 0) # define C_likely(x) __builtin_expect((x), 1) @@ -242,6 +238,10 @@ void *alloca (); # endif # define C_noret_decl(name) # define C_aligned __attribute__ ((aligned)) +/* Clang and G++ support statement expressions, but only in a limited way */ +# if !defined(__clang__) +# define HAVE_STATEMENT_EXPRESSIONS 1 +# endif # endif # if defined(__i386__) && !defined(__clang__) # define C_regparm __attribute__ ((regparm(3))) @@ -878,8 +878,7 @@ typedef void (C_ccall *C_proc)(C_word, C_word *) C_noret; # define C_UWORD_MAX UINT_MAX #endif -/* Clang and G++ support statement expressions, but only in a limited way */ -#if DEBUGBUILD && HAVE_STATEMENT_EXPRESSIONS && !defined(__clang__) && !defined(__cplusplus) +#if DEBUGBUILD && HAVE_STATEMENT_EXPRESSIONS /* These are wrappers around the following idiom: * assert(SOME_PRED(obj)); * do_something_with(obj); -- 2.1.4