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
22ddd4b9
Commit
22ddd4b9
authored
Jun 19, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify feature checks
parent
bb827341
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
31 deletions
+11
-31
include/fmt/format.h
include/fmt/format.h
+7
-25
include/fmt/prepare.h
include/fmt/prepare.h
+4
-6
No files found.
include/fmt/format.h
View file @
22ddd4b9
...
...
@@ -60,20 +60,6 @@
# define FMT_CUDA_VERSION 0
#endif
#ifdef __GNUC_LIBSTD__
# define FMT_GNUC_LIBSTD_VERSION \
(__GNUC_LIBSTD__ * 100 + __GNUC_LIBSTD_MINOR__)
#endif
// Check whether we can use unrestricted unions and use struct if not.
#ifndef FMT_UNRESTRICTED_UNION
# if FMT_MSC_VER >= 1900 || FMT_GCC_VERSION >= 406 || FMT_CLANG_VERSION >= 303
# define FMT_UNRESTRICTED_UNION union
# else
# define FMT_UNRESTRICTED_UNION struct
# endif
#endif
#ifdef __has_builtin
# define FMT_HAS_BUILTIN(x) __has_builtin(x)
#else
...
...
@@ -142,14 +128,11 @@ FMT_END_NAMESPACE
// __builtin_clz is broken in clang with Microsoft CodeGen:
// https://github.com/fmtlib/fmt/issues/519
#ifndef _MSC_VER
# if FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)
# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
# endif
# if FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
# endif
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER
# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
#endif
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
#endif
// Some compilers masquerade as both MSVC and GCC-likes or otherwise support
...
...
@@ -1727,15 +1710,14 @@ template <typename Char> struct arg_ref {
}
Kind
kind
;
FMT_UNRESTRICTED_UNION
value
{
union
value
{
FMT_CONSTEXPR
value
()
:
index
(
0u
)
{}
FMT_CONSTEXPR
value
(
unsigned
id
)
:
index
(
id
)
{}
FMT_CONSTEXPR
value
(
string_view_metadata
n
)
:
name
(
n
)
{}
unsigned
index
;
string_view_metadata
name
;
}
val
;
}
val
;
};
// Format specifiers with width and precision resolved at formatting rather
...
...
include/fmt/prepare.h
View file @
22ddd4b9
...
...
@@ -40,7 +40,7 @@ template <typename Char> struct format_part {
which_arg_id
which
;
FMT_UNRESTRICTED_UNION
value
{
union
value
{
FMT_CONSTEXPR
value
()
:
index
(
0u
)
{}
FMT_CONSTEXPR
value
(
unsigned
id
)
:
index
(
id
)
{}
FMT_CONSTEXPR
value
(
internal
::
string_view_metadata
id
)
...
...
@@ -48,8 +48,7 @@ template <typename Char> struct format_part {
unsigned
index
;
internal
::
string_view_metadata
named_index
;
}
val
;
}
val
;
};
struct
specification
{
...
...
@@ -89,7 +88,7 @@ template <typename Char> struct format_part {
which_value
which
;
std
::
size_t
end_of_argument_id
;
FMT_UNRESTRICTED_UNION
value
{
union
value
{
FMT_CONSTEXPR
value
()
:
arg_id
(
0u
)
{}
FMT_CONSTEXPR
value
(
unsigned
id
)
:
arg_id
(
id
)
{}
FMT_CONSTEXPR
value
(
named_argument_id
named_id
)
...
...
@@ -100,8 +99,7 @@ template <typename Char> struct format_part {
internal
::
string_view_metadata
named_arg_id
;
internal
::
string_view_metadata
text
;
specification
spec
;
}
val
;
}
val
;
};
namespace
internal
{
...
...
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