mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
Portable fallthrough attribute
This commit is contained in:
parent
919b002068
commit
00fe44fc71
2 changed files with 11 additions and 1 deletions
|
@ -80,7 +80,7 @@ bool GlGeometry::decomposeOutline(const Shape& shape)
|
|||
mPrimitives.push_back(GlPrimitive());
|
||||
curPrimitive = &mPrimitives.back();
|
||||
}
|
||||
__attribute__ ((fallthrough));
|
||||
TVG_FALLTHROUGH
|
||||
case PathCommand::LineTo: {
|
||||
if (curPrimitive) addPoint(*curPrimitive, pts[0], min, max);
|
||||
pts++;
|
||||
|
|
|
@ -37,6 +37,16 @@ using namespace tvg;
|
|||
#define TVG_UNUSED __attribute__ ((__unused__))
|
||||
#endif
|
||||
|
||||
// Portable 'fallthrough' attribute
|
||||
#if __has_cpp_attribute(fallthrough)
|
||||
#ifdef _MSC_VER
|
||||
#define TVG_FALLTHROUGH [[fallthrough]];
|
||||
#else
|
||||
#define TVG_FALLTHROUGH __attribute__ ((fallthrough));
|
||||
#endif
|
||||
#else
|
||||
#define TVG_FALLTHROUGH
|
||||
#endif
|
||||
|
||||
//TVG class identifier values
|
||||
#define TVG_CLASS_ID_UNDEFINED 0
|
||||
|
|
Loading…
Add table
Reference in a new issue