-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Remove dependencies on unstable MSVC/STL extensions, #18334
base: main
Are you sure you want to change the base?
Changes from all commits
3ddadf4
40e962c
cf2bd10
92eb451
e39d5ff
c2a4a14
a199a35
01a2470
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
#include <span> | ||
#include <string_view> | ||
#include <vector> | ||
#include <cassert> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code using assert but did not include the header cassert, rely on the unstable internal include relationship of STL. I think it would be better to fix it. |
||
|
||
#include <d2d1_3.h> | ||
#include <d3d11_2.h> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ namespace Microsoft::Console::Render | |
// It's important the pool is first so it can be given to the others on construction. | ||
std::pmr::unsynchronized_pool_resource _pool; | ||
std::pmr::vector<std::pmr::wstring> _polyStrings; | ||
std::pmr::vector<std::pmr::basic_string<int>> _polyWidths; | ||
std::pmr::vector<std::pmr::vector<int>> _polyWidths; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not used as string nor need the null terminator. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder why this line was changed with the title of this PR. IIRC, some developers use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. Thanks. 👍 |
||
|
||
std::vector<DWORD> _imageMask; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,10 +42,10 @@ class ConsoleWaitBlock | |
_In_ IWaitRoutine* const pWaiter); | ||
|
||
ConsoleWaitQueue* const _pProcessQueue; | ||
std::_List_const_iterator<std::_List_val<std::_List_simple_types<ConsoleWaitBlock*>>> _itProcessQueue; | ||
typename std::list<ConsoleWaitBlock*>::const_iterator _itProcessQueue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the use of unstable STL internal names. |
||
|
||
ConsoleWaitQueue* const _pObjectQueue; | ||
std::_List_const_iterator<std::_List_val<std::_List_simple_types<ConsoleWaitBlock*>>> _itObjectQueue; | ||
typename std::list<ConsoleWaitBlock*>::const_iterator _itObjectQueue; | ||
|
||
CONSOLE_API_MSG _WaitReplyMessage; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ namespace Microsoft::Console::VirtualTerminal | |
size_t _colorsUsed = 0; | ||
size_t _colorsAvailable = 0; | ||
bool _colorTableChanged = false; | ||
IndexedPixel _foregroundPixel = 0; | ||
IndexedPixel _foregroundPixel = {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The struct has two members, and allowing the use of = 0 initialization might be an MSVC extension or a bug. |
||
|
||
void _initImageBuffer(); | ||
void _resizeImageBuffer(const til::CoordType requiredHeight); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,6 +247,9 @@ void Utils::InitializeVT340ColorTable(const std::span<COLORREF> table) noexcept | |
} | ||
} | ||
|
||
#pragma warning(push) | ||
#pragma warning(disable : 26497) // This is a false positive in audit mode. | ||
|
||
// Function Description: | ||
// - Fill color table entries from 16 to 255 with the default colors used by | ||
// modern terminals. This includes a range of colors from a 6x6x6 color cube | ||
|
@@ -255,7 +258,7 @@ void Utils::InitializeVT340ColorTable(const std::span<COLORREF> table) noexcept | |
// - table: a color table to be filled | ||
// Return Value: | ||
// - <none> | ||
constexpr void Utils::InitializeExtendedColorTable(const std::span<COLORREF> table, const bool monochrome) noexcept | ||
void Utils::InitializeExtendedColorTable(const std::span<COLORREF> table, const bool monochrome) noexcept | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the strange constexpr as it might cause the function definition to be discarded, leading to missing symbols. |
||
{ | ||
if (table.size() >= 256) | ||
{ | ||
|
@@ -279,6 +282,8 @@ constexpr void Utils::InitializeExtendedColorTable(const std::span<COLORREF> tab | |
} | ||
} | ||
|
||
#pragma warning(pop) | ||
|
||
#pragma warning(push) | ||
#pragma warning(disable : 26447) // This is a false positive. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using feature test macros instead of MSVC private macros; this will no longer be necessary after upgrading to C++23. The macro _MSVC_STL_UPDATE is documented.