handle -Wimplicit-fallthrough=

This commit is contained in:
Boris Faure 2017-11-12 00:30:25 +01:00
parent 59feab991b
commit 35cb66aa2b
2 changed files with 13 additions and 3 deletions

View File

@ -549,9 +549,6 @@ config_new(void)
return config;
}
#ifndef EINA_FALLTHROUGH
#define EINA_FALLTHROUGH
#endif
Config *
config_load(const char *key)
@ -654,6 +651,7 @@ config_load(const char *key)
/*pass through*/
case 16:
config->shine = 255;
EINA_FALLTHROUGH;
/*pass through*/
case CONF_VER: /* 17 */
config->version = CONF_VER;

View File

@ -19,4 +19,16 @@ Eina_Bool link_is_email(const char *str);
#define casestartswith(str, constref) \
(!strncasecmp(str, constref, sizeof(constref) - 1))
#if (ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 20)
# if __GNUC__ >= 7
# define EINA_FALLTHROUGH __attribute__ ((fallthrough));
# else
# define EINA_FALLTHROUGH
# endif
#else
# ifndef EINA_FALLTHROUGH
# define EINA_FALLTHROUGH
# endif
#endif
#endif