summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_types.h
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2017-06-06 09:58:06 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2017-06-06 09:58:06 +0200
commit81bcc14615b7437f1548cee415347bdfb22bbede (patch)
tree2e25e85f19c60727cb43c830fb48f0eac5673693 /src/lib/eina/eina_types.h
parente24670b1e2b720ea732517af1767214e41774779 (diff)
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
Diffstat (limited to 'src/lib/eina/eina_types.h')
-rw-r--r--src/lib/eina/eina_types.h3
1 files changed, 2 insertions, 1 deletions
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 @@
196# define EINA_UNLIKELY(exp) __builtin_expect((exp), 0) 196# define EINA_UNLIKELY(exp) __builtin_expect((exp), 0)
197# define EINA_LIKELY(exp) __builtin_expect((exp), 1) 197# define EINA_LIKELY(exp) __builtin_expect((exp), 1)
198# define EINA_SENTINEL __attribute__((__sentinel__)) 198# define EINA_SENTINEL __attribute__((__sentinel__))
199# define EINA_FALLTHROUGH __attribute__ ((fallthrough));
200# ifndef __clang__ 199# ifndef __clang__
200# define EINA_FALLTHROUGH __attribute__ ((fallthrough));
201# define EINA_PREFETCH(arg) (arg ? __builtin_prefetch(arg) : (void) arg) 201# define EINA_PREFETCH(arg) (arg ? __builtin_prefetch(arg) : (void) arg)
202# define EINA_PREFETCH_WRITE(arg) (arg ? __builtin_prefetch(arg, 1) : (void) arg) 202# define EINA_PREFETCH_WRITE(arg) (arg ? __builtin_prefetch(arg, 1) : (void) arg)
203# define EINA_PREFETCH_NOCACHE(arg) (arg ? __builtin_prefetch(arg, 0, 0) : (void) arg) 203# define EINA_PREFETCH_NOCACHE(arg) (arg ? __builtin_prefetch(arg, 0, 0) : (void) arg)
204# define EINA_PREFETCH_NOCACHE_WRITE(arg) (arg ? __builtin_prefetch(arg, 1, 0) : (void) arg) 204# define EINA_PREFETCH_NOCACHE_WRITE(arg) (arg ? __builtin_prefetch(arg, 1, 0) : (void) arg)
205# else 205# else
206/* LLVM Clang workaround (crash on compilation) */ 206/* LLVM Clang workaround (crash on compilation) */
207# define EINA_FALLTHROUGH
207# define EINA_PREFETCH(arg) ((void) (arg)) 208# define EINA_PREFETCH(arg) ((void) (arg))
208# define EINA_PREFETCH_WRITE(arg) ((void) (arg)) 209# define EINA_PREFETCH_WRITE(arg) ((void) (arg))
209# define EINA_PREFETCH_NOCACHE(arg) ((void) (arg)) 210# define EINA_PREFETCH_NOCACHE(arg) ((void) (arg))