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
29511694
Commit
29511694
authored
Mar 20, 2020
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move FMT_USE_FLOAT and friends to fmt/format.h
parent
d3e66841
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
include/fmt/core.h
include/fmt/core.h
+2
-13
include/fmt/format.h
include/fmt/format.h
+15
-4
No files found.
include/fmt/core.h
View file @
29511694
...
...
@@ -284,7 +284,8 @@ FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
#ifndef FMT_ASSERT
# ifdef NDEBUG
# define FMT_ASSERT(condition, message)
// FMT_ASSERT is not empty to avoid -Werror=empty-body.
# define FMT_ASSERT(condition, message) ((void)0)
# else
# define FMT_ASSERT(condition, message) \
((condition)
/* void() fails with -Winvalid-constexpr on clang 4.0.1 */
\
...
...
@@ -316,18 +317,6 @@ struct int128_t {};
struct
uint128_t
{};
#endif
#ifndef FMT_USE_FLOAT
# define FMT_USE_FLOAT 1
#endif
#ifndef FMT_USE_DOUBLE
# define FMT_USE_DOUBLE 1
#endif
#ifndef FMT_USE_LONG_DOUBLE
# define FMT_USE_LONG_DOUBLE 1
#endif
// Casts a nonnegative integer to unsigned.
template
<
typename
Int
>
FMT_CONSTEXPR
typename
std
::
make_unsigned
<
Int
>::
type
to_unsigned
(
Int
value
)
{
...
...
include/fmt/format.h
View file @
29511694
...
...
@@ -138,6 +138,18 @@ FMT_END_NAMESPACE
# endif
#endif
#ifndef FMT_USE_FLOAT
# define FMT_USE_FLOAT 1
#endif
#ifndef FMT_USE_DOUBLE
# define FMT_USE_DOUBLE 1
#endif
#ifndef FMT_USE_LONG_DOUBLE
# define FMT_USE_LONG_DOUBLE 1
#endif
// __builtin_clz is broken in clang with Microsoft CodeGen:
// https://github.com/fmtlib/fmt/issues/519
#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER
...
...
@@ -1893,11 +1905,10 @@ class arg_formatter_base {
template
<
typename
T
,
FMT_ENABLE_IF
(
std
::
is_floating_point
<
T
>
::
value
)
>
iterator
operator
()(
T
value
)
{
if
(
const_check
(
!
is_supported_floating_point
(
value
)))
{
FMT_ASSERT
(
false
,
"unsupported float argument type"
);
return
out
();
}
if
(
const_check
(
is_supported_floating_point
(
value
)))
writer_
.
write
(
value
,
specs_
?
*
specs_
:
format_specs
());
else
FMT_ASSERT
(
false
,
"unsupported float argument type"
);
return
out
();
}
...
...
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