eina: fix clang compilation with EINA_FALLTHROUGH
authorJérémy Zurcher <jeremy@asynk.ch>
Tue, 6 Jun 2017 07:58:06 +0000 (09:58 +0200)
committerJérémy Zurcher <jeremy@asynk.ch>
Tue, 6 Jun 2017 07:58:06 +0000 (09:58 +0200)
btw, using clang 4.0.0, I can't produce fallthrough warnings using
-Weverything, -Wall or -Wimplicit-fallthrough

src/lib/eina/eina_types.h

index 1fd7a1e..57a1339 100644 (file)
 #  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))