diff --git a/src/lib/gl_engine/tvgGlGeometry.cpp b/src/lib/gl_engine/tvgGlGeometry.cpp index 0b9c7afa..8d2dc677 100644 --- a/src/lib/gl_engine/tvgGlGeometry.cpp +++ b/src/lib/gl_engine/tvgGlGeometry.cpp @@ -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++; diff --git a/src/lib/tvgCommon.h b/src/lib/tvgCommon.h index 9389156a..a2256803 100644 --- a/src/lib/tvgCommon.h +++ b/src/lib/tvgCommon.h @@ -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