From 1cfbf16e320ca9bdadd9c24eb1d2d68b25369ba6 Mon Sep 17 00:00:00 2001 From: Pimyn Girgis Date: Tue, 2 Dec 2025 12:28:10 +0000 Subject: executor: update flatbuffers Update flatbuffers to v23.5.26, which matches the compiler version in the new env container. --- executor/_include/flatbuffers/util.h | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'executor/_include/flatbuffers/util.h') diff --git a/executor/_include/flatbuffers/util.h b/executor/_include/flatbuffers/util.h index dcc5065f9..1ccf3517d 100644 --- a/executor/_include/flatbuffers/util.h +++ b/executor/_include/flatbuffers/util.h @@ -31,6 +31,8 @@ # include #endif // FLATBUFFERS_PREFER_PRINTF +#include +#include #include namespace flatbuffers { @@ -255,7 +257,7 @@ inline void strtoval_impl(double *val, const char *str, char **endptr) { } // UBSAN: double to float is safe if numeric_limits::is_iec559 is true. -__suppress_ubsan__("float-cast-overflow") +FLATBUFFERS_SUPPRESS_UBSAN("float-cast-overflow") inline void strtoval_impl(float *val, const char *str, char **endptr) { *val = __strtof_impl(str, endptr); } @@ -312,6 +314,7 @@ inline bool StringToFloatImpl(T *val, const char *const str) { strtoval_impl(val, str, const_cast(&end)); auto done = (end != str) && (*end == '\0'); if (!done) *val = 0; // erase partial result + if (done && std::isnan(*val)) { *val = std::numeric_limits::quiet_NaN(); } return done; } @@ -392,6 +395,18 @@ inline uint64_t StringToUInt(const char *s, int base = 10) { return StringToIntegerImpl(&val, s, base) ? val : 0; } +inline bool StringIsFlatbufferNan(const std::string &s) { + return s == "nan" || s == "+nan" || s == "-nan"; +} + +inline bool StringIsFlatbufferPositiveInfinity(const std::string &s) { + return s == "inf" || s == "+inf" || s == "infinity" || s == "+infinity"; +} + +inline bool StringIsFlatbufferNegativeInfinity(const std::string &s) { + return s == "-inf" || s == "-infinity"; +} + typedef bool (*LoadFileFunction)(const char *filename, bool binary, std::string *dest); typedef bool (*FileExistsFunction)(const char *filename); @@ -608,7 +623,7 @@ inline bool EscapeString(const char *s, size_t length, std::string *_text, // we previously checked for non-UTF-8, so we shouldn't reach // here. // - // 2) We reached here by someone calling GenerateText() + // 2) We reached here by someone calling GenText() // on a previously-serialized flatbuffer. The data might have // non-UTF-8 Strings, or might be corrupt. // @@ -685,9 +700,6 @@ bool SetGlobalTestLocale(const char *locale_name, bool ReadEnvironmentVariable(const char *var_name, std::string *_value = nullptr); -// MSVC specific: Send all assert reports to STDOUT to prevent CI hangs. -void SetupDefaultCRTReportMode(); - enum class Case { kUnknown = 0, // TheQuickBrownFox @@ -710,9 +722,10 @@ enum class Case { kSnake2 = 9, }; -// Convert the `input` string of case `input_case` to the specified `output_case`. +// Convert the `input` string of case `input_case` to the specified +// `output_case`. std::string ConvertCase(const std::string &input, Case output_case, - Case input_case = Case::kSnake); + Case input_case = Case::kSnake); } // namespace flatbuffers -- cgit mrf-deployment