Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Silence g++7 switch case fallthrough warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa authored and xzyfer committed Mar 17, 2018
1 parent 968020e commit 2558763
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sass_types/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace SassTypes
}

a = Nan::To<double>(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()) {
Expand Down
6 changes: 6 additions & 0 deletions src/sass_types/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#include <nan.h>
#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<Color> {
Expand Down

0 comments on commit 2558763

Please # to comment.