AP_Common: add FALLTHROUGH define

This commit is contained in:
Lucas De Marchi 2017-08-22 10:25:54 -07:00
parent bfe2acac33
commit 3102247a85
1 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,17 @@
#define FMT_PRINTF(a,b) __attribute__((format(printf, a, b)))
#define FMT_SCANF(a,b) __attribute__((format(scanf, a, b)))
#ifdef __has_cpp_attribute
# if __has_cpp_attribute(fallthrough)
# define FALLTHROUGH [[fallthrough]]
# elif __has_cpp_attribute(gnu::fallthrough)
# define FALLTHROUGH [[gnu::fallthrough]]
# endif
#endif
#ifndef FALLTHROUGH
# define FALLTHROUGH
#endif
#define ToRad(x) radians(x) // *pi/180
#define ToDeg(x) degrees(x) // *180/pi