forked from enlightenment/efl
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
This commit is contained in:
parent
e24670b1e2
commit
81bcc14615
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue