Fixed build for gcc 8 (SITL).

This commit is contained in:
Michael Keller 2019-02-25 15:34:34 +13:00
parent b5fba14cb3
commit 93f933f01f
3 changed files with 10 additions and 4 deletions

View File

@ -5,6 +5,12 @@
* under the terms of the MIT license. See LICENSE for details.
*/
#if __GNUC__ > 6
#define FALLTHROUGH __attribute__ ((fallthrough))
#else
#define FALLTHROUGH do {} while(0)
#endif
#ifdef _WIN32
#define _WIN32_WINNT 0x501
#ifndef _CRT_SECURE_NO_WARNINGS
@ -741,8 +747,8 @@ void dyad_update(void) {
break;
}
}
/* Fall through */
FALLTHROUGH;
case DYAD_STATE_CLOSING:
if (select_has(&dyad_selectSet, SELECT_WRITE, stream->sockfd)) {
stream_flushWriteBuffer(stream);

View File

@ -134,7 +134,7 @@ extern const uint8_t __pg_resetdata_end[];
#define PG_REGISTER_WITH_RESET_FN(_type, _name, _pgn, _version) \
extern void pgResetFn_ ## _name(_type *); \
PG_REGISTER_I(_type, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)&pgResetFn_ ## _name }) \
PG_REGISTER_I(_type, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)(void (*)())&pgResetFn_ ## _name }) \
/**/
#define PG_REGISTER_WITH_RESET_TEMPLATE(_type, _name, _pgn, _version) \
@ -163,7 +163,7 @@ extern const uint8_t __pg_resetdata_end[];
#define PG_REGISTER_ARRAY_WITH_RESET_FN(_type, _size, _name, _pgn, _version) \
extern void pgResetFn_ ## _name(_type *); \
PG_REGISTER_ARRAY_I(_type, _size, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)&pgResetFn_ ## _name}) \
PG_REGISTER_ARRAY_I(_type, _size, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)(void (*)())&pgResetFn_ ## _name}) \
/**/
#if 0

View File

@ -476,8 +476,8 @@ static uint16_t getRxfailValue(uint8_t channel)
return rxConfig()->rx_min_usec;
}
}
/* no break */
FALLTHROUGH;
default:
case RX_FAILSAFE_MODE_INVALID:
case RX_FAILSAFE_MODE_HOLD: