diff --git a/.github/actions/spell-check/excludes.txt b/.github/actions/spell-check/excludes.txt index 363b1706d5..f4dc4602a9 100644 --- a/.github/actions/spell-check/excludes.txt +++ b/.github/actions/spell-check/excludes.txt @@ -143,3 +143,4 @@ ignore$ src/modules/cmdpal/ext/SamplePagesExtension/Pages/SampleMarkdownImagesPage.cs ^src/modules/powerrename/unittests/testdata/avif_test\.avif$ ^src/modules/powerrename/unittests/testdata/heif_test\.heic$ +^deps/spdlog-msvc-fix/ diff --git a/deps/spdlog-msvc-fix/include/spdlog-msvc-fix.h b/deps/spdlog-msvc-fix/include/spdlog-msvc-fix.h new file mode 100644 index 0000000000..6d343f153c --- /dev/null +++ b/deps/spdlog-msvc-fix/include/spdlog-msvc-fix.h @@ -0,0 +1,94 @@ +// spdlog-msvc-fix.h +// +// Workaround for MSVC 14.51 (compiler version 19.51, _MSC_VER >= 1951) removing +// stdext::checked_array_iterator. Force-included for all spdlog consumers via +// deps/spdlog.props, because spdlog v1.8.5's bundled fmt format.h(357) still +// references this type inside #if defined(_SECURE_SCL) && _SECURE_SCL -- a +// branch entered in Debug builds where _ITERATOR_DEBUG_LEVEL > 0. +// +// On MSVC 14.50 and earlier, the type still exists in , so this shim +// is a no-op via the _MSC_VER guard. On MSVC 14.51+, it provides a minimal +// pointer-backed substitute that satisfies the bundled fmt's usage: +// +// template using checked_ptr = stdext::checked_array_iterator; +// template checked_ptr make_checked(T* p, size_t size) { +// return {p, size}; +// } +// ... return make_checked(get_data(c) + size, n); +// +// When deps/spdlog is bumped past v1.14 (which ships fmt 10.2 and drops this +// dependency), this shim and its entry in deps/spdlog.props +// can be deleted. + +#pragma once + +#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER >= 1951 + +#include +#include +#include + +namespace stdext +{ + template + class checked_array_iterator + { + _Ptr _Myarray = nullptr; + std::size_t _Mysize = 0; + std::size_t _Myindex = 0; + + public: + using iterator_category = std::random_access_iterator_tag; + using value_type = std::remove_cv_t>; + using difference_type = std::ptrdiff_t; + using pointer = _Ptr; + using reference = std::remove_pointer_t<_Ptr>&; + + constexpr checked_array_iterator() = default; + + constexpr checked_array_iterator(_Ptr arr, std::size_t size, std::size_t idx = 0) noexcept + : _Myarray(arr), _Mysize(size), _Myindex(idx) + { + } + + constexpr reference operator*() const noexcept { return _Myarray[_Myindex]; } + constexpr pointer operator->() const noexcept { return _Myarray + _Myindex; } + constexpr reference operator[](difference_type n) const noexcept + { + return _Myarray[_Myindex + static_cast(n)]; + } + + constexpr checked_array_iterator& operator++() noexcept { ++_Myindex; return *this; } + constexpr checked_array_iterator operator++(int) noexcept { auto t = *this; ++_Myindex; return t; } + constexpr checked_array_iterator& operator--() noexcept { --_Myindex; return *this; } + constexpr checked_array_iterator operator--(int) noexcept { auto t = *this; --_Myindex; return t; } + + constexpr checked_array_iterator& operator+=(difference_type n) noexcept + { + _Myindex = static_cast(static_cast(_Myindex) + n); + return *this; + } + constexpr checked_array_iterator& operator-=(difference_type n) noexcept + { + _Myindex = static_cast(static_cast(_Myindex) - n); + return *this; + } + + friend constexpr checked_array_iterator operator+(checked_array_iterator it, difference_type n) noexcept { it += n; return it; } + friend constexpr checked_array_iterator operator+(difference_type n, checked_array_iterator it) noexcept { return it + n; } + friend constexpr checked_array_iterator operator-(checked_array_iterator it, difference_type n) noexcept { it -= n; return it; } + friend constexpr difference_type operator-(checked_array_iterator a, checked_array_iterator b) noexcept + { + return static_cast(a._Myindex) - static_cast(b._Myindex); + } + + friend constexpr bool operator==(checked_array_iterator a, checked_array_iterator b) noexcept { return a._Myindex == b._Myindex; } + friend constexpr bool operator!=(checked_array_iterator a, checked_array_iterator b) noexcept { return !(a == b); } + friend constexpr bool operator<(checked_array_iterator a, checked_array_iterator b) noexcept { return a._Myindex < b._Myindex; } + friend constexpr bool operator>(checked_array_iterator a, checked_array_iterator b) noexcept { return b < a; } + friend constexpr bool operator<=(checked_array_iterator a, checked_array_iterator b) noexcept { return !(b < a); } + friend constexpr bool operator>=(checked_array_iterator a, checked_array_iterator b) noexcept { return !(a < b); } + }; +} // namespace stdext + +#endif // __cplusplus && _MSC_VER >= 1951 diff --git a/deps/spdlog.props b/deps/spdlog.props index 0c755dc5e2..f4e1014ffd 100644 --- a/deps/spdlog.props +++ b/deps/spdlog.props @@ -3,6 +3,7 @@ $(MSBuildThisFileDirectory)spdlog\include;%(AdditionalIncludeDirectories) SPDLOG_WCHAR_TO_UTF8_SUPPORT;SPDLOG_COMPILED_LIB;SPDLOG_WCHAR_FILENAMES;%(PreprocessorDefinitions) + $(MSBuildThisFileDirectory)spdlog-msvc-fix\include\spdlog-msvc-fix.h;%(ForcedIncludeFiles) diff --git a/src/modules/GrabAndMove/GrabAndMove/GrabAndMove.vcxproj b/src/modules/GrabAndMove/GrabAndMove/GrabAndMove.vcxproj index 1b2916a59f..26db82fb6d 100644 --- a/src/modules/GrabAndMove/GrabAndMove/GrabAndMove.vcxproj +++ b/src/modules/GrabAndMove/GrabAndMove/GrabAndMove.vcxproj @@ -1,6 +1,7 @@ + Debug @@ -193,5 +194,18 @@ + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/src/modules/GrabAndMove/GrabAndMove/packages.config b/src/modules/GrabAndMove/GrabAndMove/packages.config new file mode 100644 index 0000000000..97349a856f --- /dev/null +++ b/src/modules/GrabAndMove/GrabAndMove/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/src/modules/powerrename/PowerRename.FuzzingTest/PowerRename.FuzzingTest.vcxproj b/src/modules/powerrename/PowerRename.FuzzingTest/PowerRename.FuzzingTest.vcxproj index 6526b9cce8..558843bd6c 100644 --- a/src/modules/powerrename/PowerRename.FuzzingTest/PowerRename.FuzzingTest.vcxproj +++ b/src/modules/powerrename/PowerRename.FuzzingTest/PowerRename.FuzzingTest.vcxproj @@ -40,7 +40,7 @@ true true true - NDEBUG;_CONSOLE;DISABLE_FOR_FUZZING;%(PreprocessorDefinitions);_DISABLE_VECTOR_ANNOTATION;_DISABLE_STRING_ANNOTATION + NDEBUG;_CONSOLE;DISABLE_FOR_FUZZING;%(PreprocessorDefinitions);_DISABLE_VECTOR_ANNOTATION;_DISABLE_STRING_ANNOTATION;_DISABLE_OPTIONAL_ANNOTATION true NotUsing /fsanitize=address /fsanitize-coverage=inline-8bit-counters /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div %(AdditionalOptions)