|
|
|
@ -6256,9 +6256,35 @@ bool _upb_mapsorter_pushexts(_upb_mapsorter* s, |
|
|
|
|
|
|
|
|
|
// Must be last.
|
|
|
|
|
|
|
|
|
|
const float kUpb_FltInfinity = INFINITY; |
|
|
|
|
const double kUpb_Infinity = INFINITY; |
|
|
|
|
const double kUpb_NaN = NAN; |
|
|
|
|
// The latest win32 SDKs have an invalid definition of NAN.
|
|
|
|
|
// https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
|
|
|
|
|
//
|
|
|
|
|
// Unfortunately, the `0.0 / 0.0` workaround doesn't work in Clang under C23, so
|
|
|
|
|
// try __builtin_nan first, if that exists.
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
|
#ifdef __has_builtin |
|
|
|
|
#if __has_builtin(__builtin_nan) |
|
|
|
|
#define UPB_NAN __builtin_nan("0") |
|
|
|
|
#endif |
|
|
|
|
#if __has_builtin(__builtin_inf) |
|
|
|
|
#define UPB_INFINITY __builtin_inf() |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
#ifndef UPB_NAN |
|
|
|
|
#define UPB_NAN 0.0 / 0.0 |
|
|
|
|
#endif |
|
|
|
|
#ifndef UPB_INFINITY |
|
|
|
|
#define UPB_INFINITY 1.0 / 0.0 |
|
|
|
|
#endif |
|
|
|
|
#else |
|
|
|
|
// For !_WIN32, assume math.h works.
|
|
|
|
|
#define UPB_NAN NAN |
|
|
|
|
#define UPB_INFINITY INFINITY |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
const float kUpb_FltInfinity = UPB_INFINITY; |
|
|
|
|
const double kUpb_Infinity = UPB_INFINITY; |
|
|
|
|
const double kUpb_NaN = UPB_NAN; |
|
|
|
|
|
|
|
|
|
static const size_t overhead = sizeof(upb_Message_InternalData); |
|
|
|
|
|
|
|
|
|