From 2816f206fb5908f98f4fb20ac6fe01da3a6d376b Mon Sep 17 00:00:00 2001 From: OGINO Masanori Date: Fri, 12 Jun 2015 18:59:59 +0900 Subject: [PATCH] Define GCC_VERSION in util.h temporarily. Signed-off-by: OGINO Masanori --- extlib/benz/include/picrin/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extlib/benz/include/picrin/util.h b/extlib/benz/include/picrin/util.h index 5c831bad..ad816c70 100644 --- a/extlib/benz/include/picrin/util.h +++ b/extlib/benz/include/picrin/util.h @@ -56,11 +56,19 @@ extern "C" { # define PIC_GENSYM(x) PIC_GENSYM1_(__LINE__,x) #endif +#if __GNUC__ +# define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#endif #if GCC_VERSION >= 40500 || __clang__ # define PIC_UNREACHABLE() (__builtin_unreachable()) #else # define PIC_UNREACHABLE() (assert(false)) #endif +#if __GNUC__ +# undef GCC_VERSION +#endif #define PIC_SWAP(type,a,b) \ PIC_SWAP_HELPER_(type, PIC_GENSYM(tmp), a, b)