From ed45be98ea0753d08c27f1ce5294808917a47b2b Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 10 Oct 2016 14:29:20 +0200 Subject: [PATCH] * spot/misc/common.hh (SPOT_FALLTHROUGH): Work around Clang 3.5. --- spot/misc/common.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spot/misc/common.hh b/spot/misc/common.hh index 4402229a4..cb31eefba 100644 --- a/spot/misc/common.hh +++ b/spot/misc/common.hh @@ -129,7 +129,13 @@ # endif #endif #ifndef SPOT_FALLTHROUGH -# define SPOT_FALLTHROUGH while (0) +// Clang 3.5 does not support __has_cpp_attribute but has +// [[clang::fallthrough]]. +# if __clang__ +# define SPOT_FALLTHROUGH [[clang::fallthrough]] +# else +# define SPOT_FALLTHROUGH while (0) +# endif #endif namespace spot