Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
a5ca8bee
Commit
a5ca8bee
authored
Jul 26, 2019
by
ll-antn
Committed by
Wouter van Oortmerssen
Jul 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix numeric_limits<T>::max() to avoid conflict with windows.h header (#5462)
parent
09dea79a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
util.h
include/flatbuffers/util.h
+2
-2
No files found.
include/flatbuffers/util.h
View file @
a5ca8bee
...
...
@@ -327,7 +327,7 @@ template<typename T> inline bool StringToNumber(const char *s, T *val) {
int64_t
i64
;
// The errno check isn't needed, will return MAX/MIN on overflow.
if
(
StringToIntegerImpl
(
&
i64
,
s
,
0
,
false
))
{
const
int64_t
max
=
flatbuffers
::
numeric_limits
<
T
>::
max
();
const
int64_t
max
=
(
flatbuffers
::
numeric_limits
<
T
>::
max
)
();
const
int64_t
min
=
flatbuffers
::
numeric_limits
<
T
>::
lowest
();
if
(
i64
>
max
)
{
*
val
=
static_cast
<
T
>
(
max
);
...
...
@@ -365,7 +365,7 @@ inline bool StringToNumber<uint64_t>(const char *str, uint64_t *val) {
if
(
*
s
==
'-'
)
{
// For unsigned types return the max to distinguish from
// "no conversion can be performed".
*
val
=
flatbuffers
::
numeric_limits
<
uint64_t
>::
max
();
*
val
=
(
flatbuffers
::
numeric_limits
<
uint64_t
>::
max
)
();
return
false
;
}
}
...
...
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