Avoid using _FInf
etc. in numeric_limits.h
after MSVC's STL removes them
#474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I work on the Visual C++ team, where we regularly build many open-source projects, including EASTL, with development builds of the MSVC compiler and libraries, in order to prevent regressions that would affect projects. This also allows us to provide advance notice of breaking changes, such as this one:
We've merged microsoft/STL#2828, which is removing the declarations of the
_FInf
etc. variables from our headers. This change will ship in VS 2022 17.4 Preview 2, and it breaks EASTL because MSVC's STL still defines_CPPLIB_VER
(identifying ourselves as Dinkumware-derived sources).This PR uses our supported macro
_MSVC_STL_UPDATE
for identifying the updated versions of MSVC's STL, and instead uses the compiler's__builtin_huge_valf()
etc. intrinsics, plusFLT_TRUE_MIN
etc. from the UCRT.These intrinsics and macros have been available for quite some time. Note that they will improve codegen, as they produce constants that are known to the compiler. In contrast, the old internal variables are separately compiled (and modifiable!), which inhibits optimizations like constant propagation.