Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
d7fea1ba
Commit
d7fea1ba
authored
Feb 07, 2015
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try detecting clang::fallthrough using __has_cpp_attribute
and use it to silence one of the warnings in #96.
parent
83f50855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
format.h
format.h
+13
-1
No files found.
format.h
View file @
d7fea1ba
...
@@ -76,6 +76,12 @@
...
@@ -76,6 +76,12 @@
# define FMT_HAS_BUILTIN(x) 0
# define FMT_HAS_BUILTIN(x) 0
#endif
#endif
#ifdef __has_cpp_attribute
# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
#else
# define FMT_HAS_CPP_ATTRIBUTE(x) 0
#endif
#ifndef FMT_USE_VARIADIC_TEMPLATES
#ifndef FMT_USE_VARIADIC_TEMPLATES
// Variadic templates are available in GCC since version 4.4
// Variadic templates are available in GCC since version 4.4
// (http://gcc.gnu.org/projects/cxx0x.html) and in Visual C++
// (http://gcc.gnu.org/projects/cxx0x.html) and in Visual C++
...
@@ -109,6 +115,12 @@
...
@@ -109,6 +115,12 @@
# define FMT_NOEXCEPT(expr)
# define FMT_NOEXCEPT(expr)
#endif
#endif
#if FMT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
# define FMT_FALLTHROUGH [[clang::fallthrough]]
#else
# define FMT_FALLTHROUGH
#endif
// A macro to disallow the copy constructor and operator= functions
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
// This should be used in the private: declarations for a class
#define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
#define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
...
@@ -864,7 +876,7 @@ class ArgVisitor {
...
@@ -864,7 +876,7 @@ class ArgVisitor {
switch
(
arg
.
type
)
{
switch
(
arg
.
type
)
{
default:
default:
assert
(
false
);
assert
(
false
);
// Fall through.
FMT_FALLTHROUGH
;
case
Arg
:
:
INT
:
case
Arg
:
:
INT
:
return
FMT_DISPATCH
(
visit_int
(
arg
.
int_value
));
return
FMT_DISPATCH
(
visit_int
(
arg
.
int_value
));
case
Arg
:
:
UINT
:
case
Arg
:
:
UINT
:
...
...
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