Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a1afe9af
Commit
a1afe9af
authored
Dec 23, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/Compiler.h: add gcc_fallthrough
Works around build failures with ccache which may feed processed code to GCC, which doesn't have the "fall through" code comments.
parent
fe598e7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
Thread.cxx
src/player/Thread.cxx
+2
-0
Compiler.h
src/util/Compiler.h
+6
-0
format.c
src/util/format.c
+2
-0
No files found.
src/player/Thread.cxx
View file @
a1afe9af
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#include "CrossFade.hxx"
#include "CrossFade.hxx"
#include "tag/Tag.hxx"
#include "tag/Tag.hxx"
#include "Idle.hxx"
#include "Idle.hxx"
#include "util/Compiler.h"
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include "thread/Name.hxx"
#include "thread/Name.hxx"
#include "Log.hxx"
#include "Log.hxx"
...
@@ -1171,6 +1172,7 @@ try {
...
@@ -1171,6 +1172,7 @@ try {
}
}
/* fall through */
/* fall through */
gcc_fallthrough
;
case
PlayerCommand
:
:
PAUSE
:
case
PlayerCommand
:
:
PAUSE
:
next_song
.
reset
();
next_song
.
reset
();
...
...
src/util/Compiler.h
View file @
a1afe9af
...
@@ -143,6 +143,12 @@
...
@@ -143,6 +143,12 @@
#define gcc_flatten
#define gcc_flatten
#endif
#endif
#if CLANG_OR_GCC_VERSION(7,0)
#define gcc_fallthrough __attribute__((fallthrough))
#else
#define gcc_fallthrough
#endif
#ifndef __cplusplus
#ifndef __cplusplus
/* plain C99 has "restrict" */
/* plain C99 has "restrict" */
#define gcc_restrict restrict
#define gcc_restrict restrict
...
...
src/util/format.c
View file @
a1afe9af
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
*/
*/
#include "format.h"
#include "format.h"
#include "util/Compiler.h"
#include <stdbool.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdio.h>
...
@@ -238,6 +239,7 @@ format_object2(const char *format, const char **last, const void *object,
...
@@ -238,6 +239,7 @@ format_object2(const char *format, const char **last, const void *object,
}
}
/* fall through */
/* fall through */
gcc_fallthrough
;
default:
default:
/* pass-through non-escaped portions of the format string */
/* pass-through non-escaped portions of the format string */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment