[eastl] Fix error C2039 with Visual Studio 2022 (#25593)

* [eastl] Fix error C2039 with Visual Studio 2022

* x-add-version

Co-authored-by: LilyWangLL <v-lilywang@microsoft.com>
This commit is contained in:
LilyWangLL 2022-07-06 13:48:23 -07:00 committed by GitHub
parent 88bdc6d387
commit 4b16144233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 97 additions and 3 deletions

View File

@ -0,0 +1,88 @@
diff --git a/include/EASTL/numeric_limits.h b/include/EASTL/numeric_limits.h
index e991e7e9..e933c845 100644
--- a/include/EASTL/numeric_limits.h
+++ b/include/EASTL/numeric_limits.h
@@ -1435,6 +1435,19 @@ namespace eastl
static value_type round_error()
{ return 0.5f; }
+ #if defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L // If using a recent version of MSVC's STL...
+ static value_type infinity()
+ { return __builtin_huge_valf(); }
+
+ static value_type quiet_NaN()
+ { return __builtin_nanf("0"); }
+
+ static value_type signaling_NaN()
+ { return __builtin_nansf("1"); }
+
+ static value_type denorm_min()
+ { return FLT_TRUE_MIN; }
+ #else
static value_type infinity()
{ return _CSTD _FInf._Float; }
@@ -1446,6 +1459,7 @@ namespace eastl
static value_type denorm_min()
{ return _CSTD _FDenorm._Float; }
+ #endif
#endif
};
@@ -1553,6 +1567,19 @@ namespace eastl
static value_type round_error()
{ return 0.5f; }
+ #if defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L // If using a recent version of MSVC's STL...
+ static value_type infinity()
+ { return __builtin_huge_val(); }
+
+ static value_type quiet_NaN()
+ { return __builtin_nan("0"); }
+
+ static value_type signaling_NaN()
+ { return __builtin_nans("1"); }
+
+ static value_type denorm_min()
+ { return DBL_TRUE_MIN; }
+ #else
static value_type infinity()
{ return _CSTD _Inf._Double; }
@@ -1564,6 +1591,7 @@ namespace eastl
static value_type denorm_min()
{ return _CSTD _Denorm._Double; }
+ #endif
#endif
};
@@ -1671,6 +1699,19 @@ namespace eastl
static value_type round_error()
{ return 0.5f; }
+ #if defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L // If using a recent version of MSVC's STL...
+ static value_type infinity()
+ { return __builtin_huge_val(); }
+
+ static value_type quiet_NaN()
+ { return __builtin_nan("0"); }
+
+ static value_type signaling_NaN()
+ { return __builtin_nans("1"); }
+
+ static value_type denorm_min()
+ { return LDBL_TRUE_MIN; }
+ #else
static value_type infinity()
{ return _CSTD _LInf._Long_double; }
@@ -1682,6 +1723,7 @@ namespace eastl
static value_type denorm_min()
{ return _CSTD _LDenorm._Long_double; }
+ #endif
#endif
};

View File

@ -8,7 +8,8 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix_cmake_install.patch
Fix-error-C2338.patch
Fix-error-C2338.patch
fix-error-C2039.diff
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/EASTLConfig.cmake.in" DESTINATION "${SOURCE_PATH}")

View File

@ -1,7 +1,7 @@
{
"name": "eastl",
"version-string": "3.18.00",
"port-version": 2,
"port-version": 3,
"description": "Electronic Arts Standard Template Library. It is a C++ template library of containers, algorithms, and iterators useful for runtime and tool development across multiple platforms. It is a fairly extensive and robust implementation of such a library and has an emphasis on high performance above all other considerations.",
"homepage": "https://github.com/electronicarts/EASTL",
"license": "BSD-3-Clause",

View File

@ -2022,7 +2022,7 @@
},
"eastl": {
"baseline": "3.18.00",
"port-version": 2
"port-version": 3
},
"easycl": {
"baseline": "0.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e7b533fac097c3aa75f7b46630ea62f10980f87",
"version-string": "3.18.00",
"port-version": 3
},
{
"git-tree": "aa2de2990c3b1e6e008e1cafea8ad82c765278fb",
"version-string": "3.18.00",