1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-20 17:17:13 +02:00

Supress some fall through warnings in GCC with markers. Later to be updated to attributes and include support for more compilers.

This commit is contained in:
Sandu Liviu Catalin
2019-05-24 22:17:24 +03:00
parent 68e00bce02
commit ef0fc103cd
5 changed files with 40 additions and 0 deletions

View File

@ -1417,6 +1417,7 @@ void ImportModuleAPI(PluginFuncs * vcapi, CCStr mod)
switch (plugin_exports->PopulateModuleAPI(&sqmodapi, sizeof(SQMODAPI)))
{
case -1: STHROWF("%s: Incompatible module API structure", mod);
// fall through
case 0: STHROWF("%s: Invalid pointer to module API structure", mod);
}
@ -1426,6 +1427,7 @@ void ImportModuleAPI(PluginFuncs * vcapi, CCStr mod)
switch (plugin_exports->PopulateSquirrelAPI(&sqlibapi, sizeof(SQLIBAPI)))
{
case -1: STHROWF("%s: Incompatible squirrel API structure", mod);
// fall through
case 0: STHROWF("%s: Invalid pointer to squirrel API structure", mod);
}

View File

@ -286,6 +286,15 @@ typedef std::basic_string< SQChar > String;
#define SQMOD_FORCEINLINE inline
#endif
/* ------------------------------------------------------------------------------------------------
* ATTRIBUTES
*/
#if defined(__GNUC__) && __GNUC__ >= 7
#define SQ_FALL_THROUGH __attribute__ ((fallthrough))
#else
#define SQ_FALL_THROUGH ((void)0)
#endif // __GNUC__ >= 7
/* ------------------------------------------------------------------------------------------------
* LOGGING LOCATION
*/