Skip to content

Commit

Permalink
REGRESSION(263331@main): [GTK] MiniBrowser cannot be built with clang…
Browse files Browse the repository at this point in the history
… due to fallthrough attribute

https://bugs.webkit.org/show_bug.cgi?id=255915

Reviewed by Carlos Garcia Campos.

* Tools/MiniBrowser/gtk/main.c:
(parseFeaturesOptionCallback): Define and use a FALLTHROUGH macro
depending on __GNUC__ and __has_attribute to maximize compiler
compatibility.

Canonical link: https://commits.webkit.org/263358@main
  • Loading branch information
aperezdc committed Apr 25, 2023
1 parent a3084fe commit db58850
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Tools/MiniBrowser/gtk/main.c
Expand Up @@ -43,6 +43,16 @@
#include <gst/gst.h>
#endif

#if !defined(FALLTHROUGH) && defined(__GNUC__) && defined(__has_attribute)
#if __has_attribute(fallthrough)
#define FALLTHROUGH __attribute__ ((fallthrough))
#endif
#endif

#if !defined(FALLTHROUGH)
#define FALLTHROUGH
#endif

#define MINI_BROWSER_ERROR (miniBrowserErrorQuark())

static const gchar **uriArguments = NULL;
Expand Down Expand Up @@ -285,10 +295,10 @@ static gboolean parseFeaturesOptionCallback(const gchar *option, const gchar *va
case '!':
case '-':
enabled = FALSE;
[[fallthrough]];
FALLTHROUGH;
case '+':
item++;
[[fallthrough]];
FALLTHROUGH;
default:
break;
}
Expand Down

0 comments on commit db58850

Please sign in to comment.