mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13: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());
|
mPrimitives.push_back(GlPrimitive());
|
||||||
curPrimitive = &mPrimitives.back();
|
curPrimitive = &mPrimitives.back();
|
||||||
}
|
}
|
||||||
__attribute__ ((fallthrough));
|
TVG_FALLTHROUGH
|
||||||
case PathCommand::LineTo: {
|
case PathCommand::LineTo: {
|
||||||
if (curPrimitive) addPoint(*curPrimitive, pts[0], min, max);
|
if (curPrimitive) addPoint(*curPrimitive, pts[0], min, max);
|
||||||
pts++;
|
pts++;
|
||||||
|
|
|
@ -37,6 +37,16 @@ using namespace tvg;
|
||||||
#define TVG_UNUSED __attribute__ ((__unused__))
|
#define TVG_UNUSED __attribute__ ((__unused__))
|
||||||
#endif
|
#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
|
//TVG class identifier values
|
||||||
#define TVG_CLASS_ID_UNDEFINED 0
|
#define TVG_CLASS_ID_UNDEFINED 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue