[upb] Fixed NAN/INFINITY definitions to work on Windows 11 SDK (#40039)

This commit is contained in:
Cheney Wang 2024-07-24 10:25:37 -07:00 committed by GitHub
parent 6fb9a26cf4
commit 90cd8f5a21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,17 @@
diff --git a/upb/message/message.c b/upb/message/message.c
index 265d30d..afc6e51 100644
--- a/upb/message/message.c
+++ b/upb/message/message.c
@@ -15,9 +15,9 @@
// Must be last.
#include "upb/port/def.inc"
-const float kUpb_FltInfinity = INFINITY;
-const double kUpb_Infinity = INFINITY;
-const double kUpb_NaN = NAN;
+const float kUpb_FltInfinity = (float)(1.0 / 0.0);
+const double kUpb_Infinity = 1.0 / 0.0;
+const double kUpb_NaN = 0.0 / 0.0;
static const size_t overhead = sizeof(upb_Message_InternalData);

View File

@ -8,6 +8,7 @@ vcpkg_from_github(
HEAD_REF main
PATCHES
fix-cmake.patch
fix-NAN-on-Win11.patch
)
vcpkg_check_features(

View File

@ -1,6 +1,7 @@
{
"name": "upb",
"version": "4.25.1",
"port-version": 1,
"description": "μpb (often written 'upb') is a small protobuf implementation written in C.",
"homepage": "https://github.com/protocolbuffers/protobuf",
"license": "BSD-2-Clause",

View File

@ -9062,7 +9062,7 @@
},
"upb": {
"baseline": "4.25.1",
"port-version": 0
"port-version": 1
},
"urdfdom": {
"baseline": "3.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "47d5e848e2c7213cc67e4dfa6c7797fa973f2c12",
"version": "4.25.1",
"port-version": 1
},
{
"git-tree": "3edd5c1f37803c69faaf1b0884791e8c1d8ff48f",
"version": "4.25.1",