Fix binary output different in different platform (#7718)

* Fix binary output different in different platform, due to the nan serialization

* Add check generated code on windows ci

* Remove resdundant script

* Fix eof, and check script

* Minor bug in gen code script

* Fix windows script, remove redundant scripts

* Undelete redundante codes

* Fix github action

* Ignore eof generate grpc

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
Saman
2023-01-11 04:04:25 +08:00
committed by GitHub
parent 40758674b1
commit 62e4d2e5b2
7 changed files with 52 additions and 69 deletions

View File

@@ -31,6 +31,7 @@
# include <stdio.h>
#endif // FLATBUFFERS_PREFER_PRINTF
#include <cmath>
#include <limits>
#include <string>
@@ -313,6 +314,7 @@ inline bool StringToFloatImpl(T *val, const char *const str) {
strtoval_impl(val, str, const_cast<char **>(&end));
auto done = (end != str) && (*end == '\0');
if (!done) *val = 0; // erase partial result
if (done && std::isnan(*val)) { *val = std::numeric_limits<T>::quiet_NaN(); }
return done;
}