From a7648cda4017551c1c97c61362eb52d95fbe68e7 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 17 Jul 2017 10:43:01 +0200 Subject: [PATCH] make MWAW_FALLTHROUGH decl. more verbose again ... because older clang doesn't like the former one: ./libmwaw_internal.hxx:122:58: error: token is not a valid binary operator in a preprocessor subexpression ~~~~~~~~~~~~~~~~~~~^ --- src/lib/libmwaw_internal.hxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/libmwaw_internal.hxx b/src/lib/libmwaw_internal.hxx index 4c9580d..cbf0fc0 100644 --- a/src/lib/libmwaw_internal.hxx +++ b/src/lib/libmwaw_internal.hxx @@ -117,17 +117,20 @@ struct MWAW_shared_ptr_noop_deleter { #endif /** fall through attributes */ -#define MWAW_FALLTHROUGH -#if defined(__clang__) +#if defined(__clang__) && defined(__has_cpp_attribute) -# if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough) -# undef MWAW_FALLTHROUGH +# if __has_cpp_attribute(clang::fallthrough) # define MWAW_FALLTHROUGH [[clang::fallthrough]] +# else +# define MWAW_FALLTHROUGH # endif #elif defined(__GNUC__) # if __GNUC__>=7 -# undef MWAW_FALLTHROUGH -# define MWAW_FALLTHROUGH __attribute__ ((fallthrough)) +# define MWAW_FALLTHROUGH [[fallthrough]] +# else +# define MWAW_FALLTHROUGH # endif +#else +# define MWAW_FALLTHROUGH #endif /* ---------- debug --------------- */ -- 2.13.0