From: Jérémy Zurcher Date: Tue, 6 Jun 2017 07:58:06 +0000 (+0200) Subject: eina: fix clang compilation with EINA_FALLTHROUGH X-Git-Tag: upstream/1.20.0~753 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81bcc14615b7437f1548cee415347bdfb22bbede;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h index 1fd7a1e..57a1339 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))