From 4b16144233863d06846b9e8441571bf64a707bd1 Mon Sep 17 00:00:00 2001 From: LilyWangLL <94091114+LilyWangLL@users.noreply.github.com> Date: Wed, 6 Jul 2022 13:48:23 -0700 Subject: [PATCH] [eastl] Fix error C2039 with Visual Studio 2022 (#25593) * [eastl] Fix error C2039 with Visual Studio 2022 * x-add-version Co-authored-by: LilyWangLL --- ports/eastl/fix-error-C2039.diff | 88 ++++++++++++++++++++++++++++++++ ports/eastl/portfile.cmake | 3 +- ports/eastl/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/e-/eastl.json | 5 ++ 5 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 ports/eastl/fix-error-C2039.diff diff --git a/ports/eastl/fix-error-C2039.diff b/ports/eastl/fix-error-C2039.diff new file mode 100644 index 0000000000..8b464b6dd6 --- /dev/null +++ b/ports/eastl/fix-error-C2039.diff @@ -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 + }; diff --git a/ports/eastl/portfile.cmake b/ports/eastl/portfile.cmake index 04ba63fc55..1c8185fa8c 100644 --- a/ports/eastl/portfile.cmake +++ b/ports/eastl/portfile.cmake @@ -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}") diff --git a/ports/eastl/vcpkg.json b/ports/eastl/vcpkg.json index b2c97ba50c..7db58cc90a 100644 --- a/ports/eastl/vcpkg.json +++ b/ports/eastl/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index e25b7c6116..0e5a667a4a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2022,7 +2022,7 @@ }, "eastl": { "baseline": "3.18.00", - "port-version": 2 + "port-version": 3 }, "easycl": { "baseline": "0.3", diff --git a/versions/e-/eastl.json b/versions/e-/eastl.json index a62180cf88..e851e47cf8 100644 --- a/versions/e-/eastl.json +++ b/versions/e-/eastl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "1e7b533fac097c3aa75f7b46630ea62f10980f87", + "version-string": "3.18.00", + "port-version": 3 + }, { "git-tree": "aa2de2990c3b1e6e008e1cafea8ad82c765278fb", "version-string": "3.18.00",