From 81bcc14615b7437f1548cee415347bdfb22bbede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 6 Jun 2017 09:58:06 +0200 Subject: [PATCH] eina: fix clang compilation with EINA_FALLTHROUGH btw, using clang 4.0.0, I can't produce fallthrough warnings using -Weverything, -Wall or -Wimplicit-fallthrough --- src/lib/eina/eina_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h index 1fd7a1e26c..57a1339fad 100644 --- a/src/lib/eina/eina_types.h +++ b/src/lib/eina/eina_types.h @@ -196,14 +196,15 @@ # define EINA_UNLIKELY(exp) __builtin_expect((exp), 0) # define EINA_LIKELY(exp) __builtin_expect((exp), 1) # define EINA_SENTINEL __attribute__((__sentinel__)) -# define EINA_FALLTHROUGH __attribute__ ((fallthrough)); # ifndef __clang__ +# define EINA_FALLTHROUGH __attribute__ ((fallthrough)); # define EINA_PREFETCH(arg) (arg ? __builtin_prefetch(arg) : (void) arg) # define EINA_PREFETCH_WRITE(arg) (arg ? __builtin_prefetch(arg, 1) : (void) arg) # define EINA_PREFETCH_NOCACHE(arg) (arg ? __builtin_prefetch(arg, 0, 0) : (void) arg) # define EINA_PREFETCH_NOCACHE_WRITE(arg) (arg ? __builtin_prefetch(arg, 1, 0) : (void) arg) # else /* LLVM Clang workaround (crash on compilation) */ +# define EINA_FALLTHROUGH # define EINA_PREFETCH(arg) ((void) (arg)) # define EINA_PREFETCH_WRITE(arg) ((void) (arg)) # define EINA_PREFETCH_NOCACHE(arg) ((void) (arg))