From 1f1f4e4b9019a76362e705dc7273d692301914a2 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Sun, 15 Aug 2021 22:46:20 +0200 Subject: [PATCH] Build with clang-cl --- oss/libpopcnt/libpopcnt.h | 9 ------- src/buffer/out/CharRow.hpp | 6 ++--- src/buffer/out/OutputCellIterator.cpp | 21 +++++++-------- src/buffer/out/OutputCellView.cpp | 2 +- src/buffer/out/TextAttribute.hpp | 26 +++++-------------- src/buffer/out/TextColor.h | 12 ++++----- src/buffer/out/cursor.cpp | 1 - src/buffer/out/cursor.h | 1 - src/buffer/out/lib/bufferout.vcxproj | 9 +++++++ src/buffer/out/textBuffer.hpp | 2 +- src/buffer/out/textBufferCellIterator.cpp | 8 +++--- src/buffer/out/textBufferTextIterator.cpp | 4 +-- src/common.build.pre.props | 4 +-- src/host/precomp.h | 1 - src/inc/HostAndPropsheetIncludes.h | 6 ++++- src/inc/LibraryIncludes.h | 6 ++--- src/inc/til/rectangle.h | 8 +++--- src/inc/til/static_map.h | 2 +- src/inc/til/string.h | 6 ----- src/propslib/precomp.h | 6 ++++- src/renderer/atlas/atlas.vcxproj | 9 +++++++ src/renderer/base/lib/base.vcxproj | 9 +++++++ src/renderer/dx/DxRenderer.cpp | 2 +- src/renderer/dx/lib/dx.vcxproj | 9 +++++++ src/renderer/vt/lib/vt.vcxproj | 11 +++++++- src/server/lib/server.vcxproj | 9 +++++++ src/server/precomp.h | 16 +++--------- .../adapter/adaptDispatchGraphics.cpp | 2 +- src/terminal/adapter/lib/adapter.vcxproj | 11 +++++++- src/terminal/adapter/telemetry.cpp | 2 +- src/terminal/input/lib/terminalinput.vcxproj | 11 +++++++- .../parser/InputStateMachineEngine.cpp | 2 +- src/terminal/parser/lib/parser.vcxproj | 11 +++++++- src/terminal/parser/stateMachine.cpp | 2 +- src/terminal/parser/telemetry.cpp | 2 +- src/types/TermControlUiaTextRange.cpp | 2 +- src/types/TermControlUiaTextRange.hpp | 2 +- src/types/lib/types.vcxproj | 9 +++++++ src/winconpty/lib/winconptylib.vcxproj | 9 +++++++ src/winconpty/precomp.h | 6 ++++- 40 files changed, 173 insertions(+), 103 deletions(-) diff --git a/oss/libpopcnt/libpopcnt.h b/oss/libpopcnt/libpopcnt.h index e23b8e408..414ff1c13 100644 --- a/oss/libpopcnt/libpopcnt.h +++ b/oss/libpopcnt/libpopcnt.h @@ -114,15 +114,6 @@ #define HAVE_AVX512 #endif -#if defined(HAVE_CPUID) && \ - CLANG_PREREQ(3, 8) && \ - __has_attribute(target) && \ - (!defined(_MSC_VER) || defined(__AVX2__)) && \ - (!defined(__apple_build_version__) || __apple_build_version__ >= 8000000) - #define HAVE_AVX2 - #define HAVE_AVX512 -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/src/buffer/out/CharRow.hpp b/src/buffer/out/CharRow.hpp index 2c6442b23..7f7e0b4e4 100644 --- a/src/buffer/out/CharRow.hpp +++ b/src/buffer/out/CharRow.hpp @@ -47,9 +47,9 @@ enum class DelimiterClass class CharRow final { public: - using glyph_type = typename wchar_t; - using value_type = typename CharRowCell; - using reference = typename CharRowCellReference; + using glyph_type = wchar_t; + using value_type = CharRowCell; + using reference = CharRowCellReference; CharRow(CharRowCell* buffer, size_t rowWidth, ROW* const pParent) noexcept; diff --git a/src/buffer/out/OutputCellIterator.cpp b/src/buffer/out/OutputCellIterator.cpp index 42ed770fb..02d3ff7e2 100644 --- a/src/buffer/out/OutputCellIterator.cpp +++ b/src/buffer/out/OutputCellIterator.cpp @@ -68,9 +68,8 @@ OutputCellIterator::OutputCellIterator(const wchar_t& wch, const TextAttribute& // - fillLimit - How many times to allow this value to be viewed/filled. Infinite if 0. OutputCellIterator::OutputCellIterator(const CHAR_INFO& charInfo, const size_t fillLimit) noexcept : _mode(Mode::Fill), - _currentView(s_GenerateView(charInfo)), - _run(), _attr(InvalidTextAttribute), + _currentView(s_GenerateView(charInfo)), _pos(0), _distance(0), _fillLimit(fillLimit) @@ -83,9 +82,9 @@ OutputCellIterator::OutputCellIterator(const CHAR_INFO& charInfo, const size_t f // - utf16Text - UTF-16 text range OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text) noexcept : _mode(Mode::LooseTextOnly), - _currentView(s_GenerateView(utf16Text)), _run(utf16Text), _attr(InvalidTextAttribute), + _currentView(s_GenerateView(utf16Text)), _pos(0), _distance(0), _fillLimit(0) @@ -99,11 +98,11 @@ OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text) noexce // - attribute - Color to apply over the entire range OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text, const TextAttribute attribute) noexcept : _mode(Mode::Loose), - _currentView(s_GenerateView(utf16Text, attribute)), _run(utf16Text), _attr(attribute), - _distance(0), + _currentView(s_GenerateView(utf16Text, attribute)), _pos(0), + _distance(0), _fillLimit(0) { } @@ -114,11 +113,11 @@ OutputCellIterator::OutputCellIterator(const std::wstring_view utf16Text, const // - legacyAttrs - One legacy color item per cell OutputCellIterator::OutputCellIterator(const gsl::span legacyAttrs) noexcept : _mode(Mode::LegacyAttr), - _currentView(s_GenerateViewLegacyAttr(til::at(legacyAttrs, 0))), _run(legacyAttrs), _attr(InvalidTextAttribute), - _distance(0), + _currentView(s_GenerateViewLegacyAttr(til::at(legacyAttrs, 0))), _pos(0), + _distance(0), _fillLimit(0) { } @@ -129,11 +128,11 @@ OutputCellIterator::OutputCellIterator(const gsl::span legacyAttrs) // - charInfos - Multiple cell with unicode text and legacy color data. OutputCellIterator::OutputCellIterator(const gsl::span charInfos) noexcept : _mode(Mode::CharInfo), - _currentView(s_GenerateView(til::at(charInfos, 0))), _run(charInfos), _attr(InvalidTextAttribute), - _distance(0), + _currentView(s_GenerateView(til::at(charInfos, 0))), _pos(0), + _distance(0), _fillLimit(0) { } @@ -144,11 +143,11 @@ OutputCellIterator::OutputCellIterator(const gsl::span charInfo // - cells - Multiple cells in a run OutputCellIterator::OutputCellIterator(const gsl::span cells) : _mode(Mode::Cell), - _currentView(s_GenerateView(til::at(cells, 0))), _run(cells), _attr(InvalidTextAttribute), - _distance(0), + _currentView(s_GenerateView(til::at(cells, 0))), _pos(0), + _distance(0), _fillLimit(0) { } diff --git a/src/buffer/out/OutputCellView.cpp b/src/buffer/out/OutputCellView.cpp index 14980d23e..f5aad351f 100644 --- a/src/buffer/out/OutputCellView.cpp +++ b/src/buffer/out/OutputCellView.cpp @@ -29,7 +29,7 @@ OutputCellView::OutputCellView(const std::wstring_view view, // - Reference to UTF-16 character data // C26445 - suppressed to enable the `TextBufferTextIterator::operator->` method which needs a non-temporary memory location holding the wstring_view. // TODO: GH 2681 - remove this suppression by reconciling the probably bad design of the iterators that leads to this being required. -[[gsl::suppress(26445)]] const std::wstring_view& OutputCellView::Chars() const noexcept +[[gsl::suppress("26445")]] const std::wstring_view& OutputCellView::Chars() const noexcept { static constexpr std::wstring_view emptyBufferCell{ L"\0", 1 }; static constexpr std::wstring_view spaceBufferCell{ L" ", 1 }; diff --git a/src/buffer/out/TextAttribute.hpp b/src/buffer/out/TextAttribute.hpp index 4906ce472..4cbc6b0b1 100644 --- a/src/buffer/out/TextAttribute.hpp +++ b/src/buffer/out/TextAttribute.hpp @@ -30,21 +30,12 @@ Revision History: class TextAttribute final { public: - constexpr TextAttribute() noexcept : - _wAttrLegacy{ 0 }, - _foreground{}, - _background{}, - _extendedAttrs{ ExtendedAttributes::Normal }, - _hyperlinkId{ 0 } - { - } + constexpr TextAttribute() noexcept = default; - explicit constexpr TextAttribute(const WORD wLegacyAttr) noexcept : + explicit TextAttribute(const WORD wLegacyAttr) noexcept : _wAttrLegacy{ gsl::narrow_cast(wLegacyAttr & META_ATTRS) }, _foreground{ s_LegacyIndexOrDefault(wLegacyAttr & FG_ATTRS, s_legacyDefaultForeground) }, - _background{ s_LegacyIndexOrDefault((wLegacyAttr & BG_ATTRS) >> 4, s_legacyDefaultBackground) }, - _extendedAttrs{ ExtendedAttributes::Normal }, - _hyperlinkId{ 0 } + _background{ s_LegacyIndexOrDefault((wLegacyAttr & BG_ATTRS) >> 4, s_legacyDefaultBackground) } { // If we're given lead/trailing byte information with the legacy color, strip it. WI_ClearAllFlags(_wAttrLegacy, COMMON_LVB_SBCSDBCS); @@ -52,11 +43,8 @@ public: constexpr TextAttribute(const COLORREF rgbForeground, const COLORREF rgbBackground) noexcept : - _wAttrLegacy{ 0 }, _foreground{ rgbForeground }, - _background{ rgbBackground }, - _extendedAttrs{ ExtendedAttributes::Normal }, - _hyperlinkId{ 0 } + _background{ rgbBackground } { } @@ -170,11 +158,11 @@ private: static BYTE s_legacyDefaultForeground; static BYTE s_legacyDefaultBackground; - uint16_t _wAttrLegacy; // sizeof: 2, alignof: 2 - uint16_t _hyperlinkId; // sizeof: 2, alignof: 2 + uint16_t _wAttrLegacy = 0; // sizeof: 2, alignof: 2 + uint16_t _hyperlinkId = 0; // sizeof: 2, alignof: 2 TextColor _foreground; // sizeof: 4, alignof: 1 TextColor _background; // sizeof: 4, alignof: 1 - ExtendedAttributes _extendedAttrs; // sizeof: 1, alignof: 1 + ExtendedAttributes _extendedAttrs = ExtendedAttributes::Normal; // sizeof: 1, alignof: 1 #ifdef UNIT_TESTING friend class TextBufferTests; diff --git a/src/buffer/out/TextColor.h b/src/buffer/out/TextColor.h index ad984702f..ad1b7e868 100644 --- a/src/buffer/out/TextColor.h +++ b/src/buffer/out/TextColor.h @@ -49,26 +49,26 @@ struct TextColor { public: constexpr TextColor() noexcept : - _meta{ ColorType::IsDefault }, _red{ 0 }, _green{ 0 }, - _blue{ 0 } + _blue{ 0 }, + _meta{ ColorType::IsDefault } { } constexpr TextColor(const BYTE index, const bool isIndex256) noexcept : - _meta{ isIndex256 ? ColorType::IsIndex256 : ColorType::IsIndex16 }, _index{ index }, _green{ 0 }, - _blue{ 0 } + _blue{ 0 }, + _meta{ isIndex256 ? ColorType::IsIndex256 : ColorType::IsIndex16 } { } constexpr TextColor(const COLORREF rgb) noexcept : - _meta{ ColorType::IsRgb }, _red{ GetRValue(rgb) }, _green{ GetGValue(rgb) }, - _blue{ GetBValue(rgb) } + _blue{ GetBValue(rgb) }, + _meta{ ColorType::IsRgb } { } diff --git a/src/buffer/out/cursor.cpp b/src/buffer/out/cursor.cpp index 1d050a215..31863d953 100644 --- a/src/buffer/out/cursor.cpp +++ b/src/buffer/out/cursor.cpp @@ -28,7 +28,6 @@ Cursor::Cursor(const ULONG ulSize, TextBuffer& parentBuffer) noexcept : _fHaveDeferredCursorRedraw(false), _ulSize(ulSize), _cursorType(CursorType::Legacy), - _fUseColor(false), _color(s_InvertCursorColor) { } diff --git a/src/buffer/out/cursor.h b/src/buffer/out/cursor.h index dbd05f535..102474420 100644 --- a/src/buffer/out/cursor.h +++ b/src/buffer/out/cursor.h @@ -117,6 +117,5 @@ private: void _RedrawCursorAlways() noexcept; CursorType _cursorType; - bool _fUseColor; COLORREF _color; }; diff --git a/src/buffer/out/lib/bufferout.vcxproj b/src/buffer/out/lib/bufferout.vcxproj index cfe899c73..f8c60f856 100644 --- a/src/buffer/out/lib/bufferout.vcxproj +++ b/src/buffer/out/lib/bufferout.vcxproj @@ -9,6 +9,15 @@ StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + diff --git a/src/buffer/out/textBuffer.hpp b/src/buffer/out/textBuffer.hpp index b59eb9713..bc8f83f6b 100644 --- a/src/buffer/out/textBuffer.hpp +++ b/src/buffer/out/textBuffer.hpp @@ -55,7 +55,7 @@ filling in the last row, and updating the screen. #include "Row.hpp" #include "TextAttribute.hpp" #include "UnicodeStorage.hpp" -#include "../types/inc/Viewport.hpp" +#include "../types/inc/viewport.hpp" #include "../buffer/out/textBufferCellIterator.hpp" #include "../buffer/out/textBufferTextIterator.hpp" diff --git a/src/buffer/out/textBufferCellIterator.cpp b/src/buffer/out/textBufferCellIterator.cpp index 64caf0c98..09a6ec10d 100644 --- a/src/buffer/out/textBufferCellIterator.cpp +++ b/src/buffer/out/textBufferCellIterator.cpp @@ -31,13 +31,13 @@ TextBufferCellIterator::TextBufferCellIterator(const TextBuffer& buffer, COORD p // - pos - Starting position to retrieve text data from (within screen buffer bounds) // - limits - Viewport limits to restrict the iterator within the buffer bounds (smaller than the buffer itself) TextBufferCellIterator::TextBufferCellIterator(const TextBuffer& buffer, COORD pos, const Viewport limits) : - _buffer(buffer), - _pos(pos), + _view({}, {}, {}, TextAttributeBehavior::Stored), _pRow(s_GetRow(buffer, pos)), + _attrIter(s_GetRow(buffer, pos)->GetAttrRow().cbegin()), + _buffer(buffer), _bounds(limits), _exceeded(false), - _view({}, {}, {}, TextAttributeBehavior::Stored), - _attrIter(s_GetRow(buffer, pos)->GetAttrRow().cbegin()) + _pos(pos) { // Throw if the bounds rectangle is not limited to the inside of the given buffer. THROW_HR_IF(E_INVALIDARG, !buffer.GetSize().IsInBounds(limits)); diff --git a/src/buffer/out/textBufferTextIterator.cpp b/src/buffer/out/textBufferTextIterator.cpp index 9687e3175..fdc0f6a4c 100644 --- a/src/buffer/out/textBufferTextIterator.cpp +++ b/src/buffer/out/textBufferTextIterator.cpp @@ -26,7 +26,7 @@ TextBufferTextIterator::TextBufferTextIterator(const TextBufferCellIterator& cel // Return Value: // - Read only UTF-16 text data // TODO GH 2682, fix design so this doesn't have to be suppressed. -[[gsl::suppress(26434)]] const std::wstring_view TextBufferTextIterator::operator*() const noexcept +[[gsl::suppress("26434")]] const std::wstring_view TextBufferTextIterator::operator*() const noexcept { return _view.Chars(); } @@ -36,7 +36,7 @@ TextBufferTextIterator::TextBufferTextIterator(const TextBufferCellIterator& cel // Return Value: // - Read only UTF-16 text data // TODO GH 2682, fix design so this doesn't have to be suppressed. -[[gsl::suppress(26434)]] const std::wstring_view* TextBufferTextIterator::operator->() const noexcept +[[gsl::suppress("26434")]] const std::wstring_view* TextBufferTextIterator::operator->() const noexcept { return &_view.Chars(); } diff --git a/src/common.build.pre.props b/src/common.build.pre.props index 4a669d92f..96066c2a7 100644 --- a/src/common.build.pre.props +++ b/src/common.build.pre.props @@ -92,10 +92,10 @@ Use - Level4 + Level1 4189;4100;4242;4389;4244 - true + false diff --git a/src/server/lib/server.vcxproj b/src/server/lib/server.vcxproj index 957ef8c00..d876dd2e7 100644 --- a/src/server/lib/server.vcxproj +++ b/src/server/lib/server.vcxproj @@ -9,6 +9,15 @@ StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + diff --git a/src/server/precomp.h b/src/server/precomp.h index 9b9b2de38..b38c355e6 100644 --- a/src/server/precomp.h +++ b/src/server/precomp.h @@ -44,20 +44,10 @@ typedef long NTSTATUS; #define FACILITY_NTWIN32 0x7 -#define __NTSTATUS_FROM_WIN32(x) ((NTSTATUS)(x) <= 0 ? ((NTSTATUS)(x)) : ((NTSTATUS)(((x)&0x0000FFFF) | (FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_ERROR))) - -#ifdef INLINE_NTSTATUS_FROM_WIN32 -#ifndef __midl -__inline NTSTATUS_FROM_WIN32(long x) -{ - return x <= 0 ? (NTSTATUS)x : (NTSTATUS)(((x)&0x0000FFFF) | (FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_ERROR); +#undef NTSTATUS_FROM_WIN32 +inline long NTSTATUS_FROM_WIN32(long x) { + return x <= 0 ? (NTSTATUS)x : (NTSTATUS) (((x) & 0x0000FFFF) | (FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_ERROR); } -#else -#define NTSTATUS_FROM_WIN32(x) __NTSTATUS_FROM_WIN32(x) -#endif -#else -#define NTSTATUS_FROM_WIN32(x) __NTSTATUS_FROM_WIN32(x) -#endif //#include diff --git a/src/terminal/adapter/adaptDispatchGraphics.cpp b/src/terminal/adapter/adaptDispatchGraphics.cpp index c258c2c44..bc4018400 100644 --- a/src/terminal/adapter/adaptDispatchGraphics.cpp +++ b/src/terminal/adapter/adaptDispatchGraphics.cpp @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -#include +#include "precomp.h" #include "adaptDispatch.hpp" #include "conGetSet.hpp" diff --git a/src/terminal/adapter/lib/adapter.vcxproj b/src/terminal/adapter/lib/adapter.vcxproj index 1626e7a7d..6c43ca97e 100644 --- a/src/terminal/adapter/lib/adapter.vcxproj +++ b/src/terminal/adapter/lib/adapter.vcxproj @@ -9,6 +9,15 @@ StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + @@ -49,4 +58,4 @@ - \ No newline at end of file + diff --git a/src/terminal/adapter/telemetry.cpp b/src/terminal/adapter/telemetry.cpp index 75de2c1c2..f4a63025a 100644 --- a/src/terminal/adapter/telemetry.cpp +++ b/src/terminal/adapter/telemetry.cpp @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -#include +#include "precomp.h" #include "telemetry.hpp" diff --git a/src/terminal/input/lib/terminalinput.vcxproj b/src/terminal/input/lib/terminalinput.vcxproj index 0dd6aead6..071cabdd4 100644 --- a/src/terminal/input/lib/terminalinput.vcxproj +++ b/src/terminal/input/lib/terminalinput.vcxproj @@ -9,6 +9,15 @@ StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + @@ -28,4 +37,4 @@ - \ No newline at end of file + diff --git a/src/terminal/parser/InputStateMachineEngine.cpp b/src/terminal/parser/InputStateMachineEngine.cpp index b06bfa84e..c7b3fed7c 100644 --- a/src/terminal/parser/InputStateMachineEngine.cpp +++ b/src/terminal/parser/InputStateMachineEngine.cpp @@ -387,7 +387,7 @@ bool InputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameter DWORD buttonState = 0; DWORD eventFlags = 0; const size_t firstParameter = parameters.at(0).value_or(0); - const til::point uiPos{ parameters.at(1) - 1, parameters.at(2) - 1 }; + const til::point uiPos{ parameters.at(1).value_or(0) - 1, parameters.at(2).value_or(0) - 1 }; modifierState = _GetSGRMouseModifierState(firstParameter); success = _UpdateSGRMouseButtonState(id, firstParameter, buttonState, eventFlags, uiPos); diff --git a/src/terminal/parser/lib/parser.vcxproj b/src/terminal/parser/lib/parser.vcxproj index d0889b344..c2ecb16de 100644 --- a/src/terminal/parser/lib/parser.vcxproj +++ b/src/terminal/parser/lib/parser.vcxproj @@ -6,9 +6,18 @@ parser TerminalParser ConTermParser - StaticLibrary + StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + diff --git a/src/terminal/parser/stateMachine.cpp b/src/terminal/parser/stateMachine.cpp index dd4761c28..a62010f66 100644 --- a/src/terminal/parser/stateMachine.cpp +++ b/src/terminal/parser/stateMachine.cpp @@ -1743,7 +1743,7 @@ void StateMachine::ProcessCharacter(const wchar_t wch) } else if (_state < VTStates::TotalStates) { - static constexpr alignas(64) void (StateMachine::*funcs[])(wchar_t) = { + alignas(64) static constexpr void (StateMachine::*funcs[])(wchar_t) = { &StateMachine::_EventGround, // VTStates::Ground &StateMachine::_EventEscape, // VTStates::Escape &StateMachine::_EventEscapeIntermediate, // VTStates::EscapeIntermediate diff --git a/src/terminal/parser/telemetry.cpp b/src/terminal/parser/telemetry.cpp index 12a2235d4..86fad26ff 100644 --- a/src/terminal/parser/telemetry.cpp +++ b/src/terminal/parser/telemetry.cpp @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -#include +#include "precomp.h" #include "telemetry.hpp" diff --git a/src/types/TermControlUiaTextRange.cpp b/src/types/TermControlUiaTextRange.cpp index ba5128885..a65e1300a 100644 --- a/src/types/TermControlUiaTextRange.cpp +++ b/src/types/TermControlUiaTextRange.cpp @@ -148,7 +148,7 @@ void TermControlUiaTextRange::_TranslatePointFromScreen(LPPOINT screenPoint) con screenPoint->y = includeOffsets(screenPoint->y, boundingRect.top, padding.top, scaleFactor); } -const COORD TermControlUiaTextRange::_getScreenFontSize() const +const COORD TermControlUiaTextRange::_getScreenFontSize() const noexcept { // Do NOT get the font info from IRenderData. It is a dummy font info. // Instead, the font info is saved in the TermControl. So we have to diff --git a/src/types/TermControlUiaTextRange.hpp b/src/types/TermControlUiaTextRange.hpp index 4ec34277a..42afc210b 100644 --- a/src/types/TermControlUiaTextRange.hpp +++ b/src/types/TermControlUiaTextRange.hpp @@ -57,6 +57,6 @@ namespace Microsoft::Terminal protected: void _TranslatePointToScreen(LPPOINT clientPoint) const override; void _TranslatePointFromScreen(LPPOINT screenPoint) const override; - const COORD _getScreenFontSize() const override; + const COORD _getScreenFontSize() const noexcept override; }; } diff --git a/src/types/lib/types.vcxproj b/src/types/lib/types.vcxproj index e401b6cd9..ed0f4f2ef 100644 --- a/src/types/lib/types.vcxproj +++ b/src/types/lib/types.vcxproj @@ -9,6 +9,15 @@ StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + diff --git a/src/winconpty/lib/winconptylib.vcxproj b/src/winconpty/lib/winconptylib.vcxproj index ea4b63f83..b8b4799f7 100644 --- a/src/winconpty/lib/winconptylib.vcxproj +++ b/src/winconpty/lib/winconptylib.vcxproj @@ -9,6 +9,15 @@ StaticLibrary + + ClangCL + + + + -O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions) + stdcpplatest + + diff --git a/src/winconpty/precomp.h b/src/winconpty/precomp.h index 6bf892eac..ca215efa9 100644 --- a/src/winconpty/precomp.h +++ b/src/winconpty/precomp.h @@ -33,12 +33,16 @@ typedef NTSTATUS* PNTSTATUS; // End From ntdef.h -#define INLINE_NTSTATUS_FROM_WIN32 1 // Must use inline NTSTATUS or it will call the wrapped function twice. #pragma warning(push) #pragma warning(disable : 4430) // Must disable 4430 "default int" warning for C++ because ntstatus.h is inflexible SDK definition. #include #pragma warning(pop) +#undef NTSTATUS_FROM_WIN32 +inline long NTSTATUS_FROM_WIN32(long x) { + return x <= 0 ? (NTSTATUS)x : (NTSTATUS) (((x) & 0x0000FFFF) | (FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_ERROR); +} + #include #include "../host/conddkrefs.h"