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
6cc758b6
Commit
6cc758b6
authored
Feb 27, 2013
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround MSCRT brain damage, take 2.
parent
ab05af06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
format.h
format.h
+8
-15
No files found.
format.h
View file @
6cc758b6
...
@@ -40,11 +40,6 @@
...
@@ -40,11 +40,6 @@
#include <string>
#include <string>
#include <sstream>
#include <sstream>
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
# define FMT_RESTORE_WARNINGS
#endif
namespace
fmt
{
namespace
fmt
{
namespace
internal
{
namespace
internal
{
...
@@ -188,6 +183,8 @@ inline int IsInf(double x) {
...
@@ -188,6 +183,8 @@ inline int IsInf(double x) {
#endif
#endif
}
}
#define FMT_SNPRINTF snprintf
#else
#else
inline
int
SignBit
(
double
value
)
{
inline
int
SignBit
(
double
value
)
{
...
@@ -200,8 +197,7 @@ inline int SignBit(double value) {
...
@@ -200,8 +197,7 @@ inline int SignBit(double value) {
inline
int
IsInf
(
double
x
)
{
return
!
_finite
(
x
);
}
inline
int
IsInf
(
double
x
)
{
return
!
_finite
(
x
);
}
# undef snprintf
#define FMT_SNPRINTF sprintf_s
# define snprintf _snprintf
#endif
#endif
...
@@ -698,12 +694,13 @@ void BasicWriter<Char>::FormatDouble(
...
@@ -698,12 +694,13 @@ void BasicWriter<Char>::FormatDouble(
Char
*
start
=
&
buffer_
[
offset
];
Char
*
start
=
&
buffer_
[
offset
];
if
(
width_for_sprintf
==
0
)
{
if
(
width_for_sprintf
==
0
)
{
n
=
precision
<
0
?
n
=
precision
<
0
?
snprintf
(
start
,
size
,
format
,
value
)
:
FMT_SNPRINTF
(
start
,
size
,
format
,
value
)
:
snprintf
(
start
,
size
,
format
,
precision
,
value
);
FMT_SNPRINTF
(
start
,
size
,
format
,
precision
,
value
);
}
else
{
}
else
{
n
=
precision
<
0
?
n
=
precision
<
0
?
snprintf
(
start
,
size
,
format
,
width_for_sprintf
,
value
)
:
FMT_SNPRINTF
(
start
,
size
,
format
,
width_for_sprintf
,
value
)
:
snprintf
(
start
,
size
,
format
,
width_for_sprintf
,
precision
,
value
);
FMT_SNPRINTF
(
start
,
size
,
format
,
width_for_sprintf
,
precision
,
value
);
}
}
if
(
n
>=
0
&&
offset
+
n
<
buffer_
.
capacity
())
{
if
(
n
>=
0
&&
offset
+
n
<
buffer_
.
capacity
())
{
if
(
sign
)
{
if
(
sign
)
{
...
@@ -1552,8 +1549,4 @@ void BasicFormatter<Char>::DoFormat() {
...
@@ -1552,8 +1549,4 @@ void BasicFormatter<Char>::DoFormat() {
}
}
}
}
#ifndef FMT_RESTORE_WARNINGS
# undef _CRT_SECURE_NO_WARNINGS
#endif
#endif // FORMAT_H_
#endif // FORMAT_H_
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