Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions ports/eastl/fix-error-C2039.diff
Original file line number Diff line number Diff line change
@@ -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
};
3 changes: 2 additions & 1 deletion ports/eastl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion ports/eastl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 1 addition & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"baseline": "3.0.5",
"port-version": 0
},

"abseil": {
"baseline": "20211102.1",
"port-version": 0
Expand Down Expand Up @@ -2023,7 +2022,7 @@
},
"eastl": {
"baseline": "3.18.00",
"port-version": 2
"port-version": 3
},
"easycl": {
"baseline": "0.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/e-/eastl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e7b533fac097c3aa75f7b46630ea62f10980f87",
"version-string": "3.18.00",
"port-version": 3
},
{
"git-tree": "aa2de2990c3b1e6e008e1cafea8ad82c765278fb",
"version-string": "3.18.00",
Expand Down