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
be785a8a
Commit
be785a8a
authored
Jul 29, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MSVC build.
parent
d346a412
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
format.cc
format.cc
+11
-6
No files found.
format.cc
View file @
be785a8a
...
...
@@ -63,11 +63,16 @@ namespace {
#ifndef _MSC_VER
// Portable version of signbit.
// When compiled in C++11 mode signbit is no longer a macro but a function
// defined in namespace std and the macro is undefined.
#ifndef signbit
using
std
::
signbit
;
inline
int
getsign
(
double
x
)
{
#ifdef signbit
return
signbit
(
x
);
#else
return
std
::
signbit
(
x
);
#endif
}
// Portable version of isinf.
inline
int
isinfinity
(
double
x
)
{
...
...
@@ -82,7 +87,7 @@ inline int isinfinity(double x) {
#else // _MSC_VER
inline
int
signbit
(
double
value
)
{
inline
int
getsign
(
double
value
)
{
if
(
value
<
0
)
return
1
;
if
(
value
==
value
)
return
0
;
int
dec
=
0
,
sign
=
0
;
...
...
@@ -210,7 +215,7 @@ inline Arg::StringValue<wchar_t> ignore_incompatible_str(
Arg
::
StringValue
<
wchar_t
>
s
)
{
return
s
;
}
}
// namespace
int
fmt
::
internal
::
signbit_noinline
(
double
value
)
{
return
signbit
(
value
);
}
int
fmt
::
internal
::
signbit_noinline
(
double
value
)
{
return
getsign
(
value
);
}
void
fmt
::
SystemError
::
init
(
int
error_code
,
StringRef
format_str
,
const
ArgList
&
args
)
{
...
...
@@ -527,9 +532,9 @@ void fmt::BasicWriter<Char>::write_double(T value, const FormatSpec &spec) {
}
char
sign
=
0
;
// Use
signbit
instead of value < 0 because the latter is always
// Use
getsign
instead of value < 0 because the latter is always
// false for NaN.
if
(
signbit
(
static_cast
<
double
>
(
value
)))
{
if
(
getsign
(
static_cast
<
double
>
(
value
)))
{
sign
=
'-'
;
value
=
-
value
;
}
else
if
(
spec
.
flag
(
SIGN_FLAG
))
{
...
...
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