From 2558763266ecb515951809e5d6b9c846faa17a14 Mon Sep 17 00:00:00 2001 From: Benjamin Byholm Date: Sat, 17 Mar 2018 14:44:10 +0200 Subject: [PATCH] Silence g++7 switch case fallthrough warnings --- src/sass_types/color.cpp | 2 +- src/sass_types/color.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sass_types/color.cpp b/src/sass_types/color.cpp index 57efab3da..40358a2c3 100644 --- a/src/sass_types/color.cpp +++ b/src/sass_types/color.cpp @@ -28,7 +28,7 @@ namespace SassTypes } a = Nan::To(raw_val[3]).FromJust(); - // fall through vvv + NODE_SASS_FALLTHROUGH; case 3: if (!raw_val[0]->IsNumber() || !raw_val[1]->IsNumber() || !raw_val[2]->IsNumber()) { diff --git a/src/sass_types/color.h b/src/sass_types/color.h index 0be355110..1bf904307 100644 --- a/src/sass_types/color.h +++ b/src/sass_types/color.h @@ -4,6 +4,12 @@ #include #include "sass_value_wrapper.h" +#if defined(__GNUC__) && __GNUC__ >= 7 +#define NODE_SASS_FALLTHROUGH __attribute__ ((fallthrough)) +#else +#define NODE_SASS_FALLTHROUGH +#endif + namespace SassTypes { class Color : public SassValueWrapper {