Build with clang-cl

This commit is contained in:
Leonard Hecker 2021-08-15 22:46:20 +02:00
parent 215e5ac8e5
commit 1f1f4e4b90
40 changed files with 173 additions and 103 deletions

View file

@ -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

View file

@ -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;

View file

@ -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<const WORD> 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<const WORD> legacyAttrs)
// - charInfos - Multiple cell with unicode text and legacy color data.
OutputCellIterator::OutputCellIterator(const gsl::span<const CHAR_INFO> 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<const CHAR_INFO> charInfo
// - cells - Multiple cells in a run
OutputCellIterator::OutputCellIterator(const gsl::span<const OutputCell> 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)
{
}

View file

@ -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 };

View file

@ -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<WORD>(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;

View file

@ -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 }
{
}

View file

@ -28,7 +28,6 @@ Cursor::Cursor(const ULONG ulSize, TextBuffer& parentBuffer) noexcept :
_fHaveDeferredCursorRedraw(false),
_ulSize(ulSize),
_cursorType(CursorType::Legacy),
_fUseColor(false),
_color(s_InvertCursorColor)
{
}

View file

@ -117,6 +117,5 @@ private:
void _RedrawCursorAlways() noexcept;
CursorType _cursorType;
bool _fUseColor;
COLORREF _color;
};

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\AttrRow.cpp" />
<ClCompile Include="..\cursor.cpp" />

View file

@ -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"

View file

@ -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));

View file

@ -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();
}

View file

@ -92,10 +92,10 @@
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatSpecificWarningsAsErrors>4189;4100;4242;4389;4244</TreatSpecificWarningsAsErrors>
<!--<WarningLevel>EnableAllWarnings</WarningLevel>-->
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<!--
C4103: alignment changed after including header, may be due to missing #pragma pack(pop)
Caused by a regression in VS 16.10, it detects the use of /pshpack[1248].h/ in system headers.

View file

@ -56,7 +56,6 @@ Abstract:
#include <intsafe.h>
#pragma prefast(pop)
#include <strsafe.h>
#include <cwchar>
#include <mmsystem.h>
#include "utils.hpp"

View file

@ -23,12 +23,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 <ntstatus.h>
#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 <initguid.h>
#ifdef EXTERNAL_BUILD

View file

@ -51,8 +51,8 @@
#include <vector>
// WIL
#include <wil/Common.h>
#include <wil/Result.h>
#include <wil/common.h>
#include <wil/result.h>
#include <wil/nt_result_macros.h>
#include <wil/resource.h>
#include <wil/wistd_memory.h>
@ -69,7 +69,7 @@
#include <gsl/span_ext>
// CppCoreCheck
#include <CppCoreCheck/Warnings.h>
#include <CppCoreCheck/warnings.h>
// Chromium Numerics (safe math)
#pragma warning(push)

View file

@ -15,16 +15,16 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
{
public:
constexpr _rectangle_const_iterator(point topLeft, point bottomRight) :
_current(topLeft),
_topLeft(topLeft),
_bottomRight(bottomRight),
_current(topLeft)
_bottomRight(bottomRight)
{
}
constexpr _rectangle_const_iterator(point topLeft, point bottomRight, point start) :
_current(start),
_topLeft(topLeft),
_bottomRight(bottomRight),
_current(start)
_bottomRight(bottomRight)
{
}

View file

@ -97,7 +97,7 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
public:
template<typename... Args>
constexpr explicit presorted_static_map(const Args&... args) noexcept :
static_map{ args... } {};
static_map<K, V, Compare, N, details::presorted_input_t>{ args... } {};
};
// this is a deduction guide that ensures two things:

View file

@ -34,9 +34,6 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
template<typename T, typename Traits>
constexpr bool starts_with(const std::basic_string_view<T, Traits>& str, const std::basic_string_view<T, Traits>& prefix) noexcept
{
#ifdef __cpp_lib_starts_ends_with
#error This code can be replaced in C++20, which natively supports .starts_with().
#endif
return str.size() >= prefix.size() && Traits::compare(str.data(), prefix.data(), prefix.size()) == 0;
}
@ -54,9 +51,6 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
template<typename T, typename Traits>
constexpr bool ends_with(const std::basic_string_view<T, Traits>& str, const std::basic_string_view<T, Traits>& prefix) noexcept
{
#ifdef __cpp_lib_ends_ends_with
#error This code can be replaced in C++20, which natively supports .ends_with().
#endif
#pragma warning(push)
#pragma warning(disable : 26481) // Don't use pointer arithmetic. Use span instead (bounds.1).
return str.size() >= prefix.size() && Traits::compare(str.data() + (str.size() - prefix.size()), prefix.data(), prefix.size()) == 0;

View file

@ -17,12 +17,16 @@ typedef NTSTATUS* PNTSTATUS;
/*lint -restore */ // Resume checking for different typedefs.
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#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 <ntstatus.h>
#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);
}
#ifdef EXTERNAL_BUILD
#include <ShlObj.h>
#else

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\BlinkingState.cpp" />
<ClCompile Include="..\Cluster.cpp" />

View file

@ -1002,7 +1002,7 @@ try
{
// Enable shader effects if the path isn't empty. Otherwise leave it untouched.
_terminalEffectsEnabled = value.empty() ? _terminalEffectsEnabled : true;
_pixelShaderPath = { value };
_pixelShaderPath = value;
_recreateDeviceRequested = true;
LOG_IF_FAILED(InvalidateAll());
}

View file

@ -14,6 +14,15 @@
</Midl>
</ItemDefinitionGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\BoxDrawingEffect.cpp" />
<ClCompile Include="..\CustomTextLayout.cpp" />

View file

@ -6,9 +6,18 @@
<RootNamespace>vt</RootNamespace>
<ProjectName>RendererVt</ProjectName>
<TargetName>ConRenderVt</TargetName>
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props"/>
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<!-- DONT ADD NEW FILES HERE, ADD THEM TO vt-renderer-common.vcxitems -->
<Import Project="$(SolutionDir)src\renderer\vt\vt-renderer-common.vcxitems" />
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\ApiDispatchers.cpp" />
<ClCompile Include="..\ApiDispatchersInternal.cpp" />

View file

@ -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 <ntstatus.h>

View file

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <precomp.h>
#include "precomp.h"
#include "adaptDispatch.hpp"
#include "conGetSet.hpp"

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\adaptDispatch.cpp" />
<ClCompile Include="..\DispatchCommon.cpp" />
@ -49,4 +58,4 @@
</ItemGroup>
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
<Import Project="$(SolutionDir)src\common.build.post.props" />
</Project>
</Project>

View file

@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <precomp.h>
#include "precomp.h"
#include "telemetry.hpp"

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\mouseInput.cpp" />
<ClCompile Include="..\mouseInputState.cpp" />
@ -28,4 +37,4 @@
</ItemGroup>
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
<Import Project="$(SolutionDir)src\common.build.post.props" />
</Project>
</Project>

View file

@ -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);

View file

@ -6,9 +6,18 @@
<RootNamespace>parser</RootNamespace>
<ProjectName>TerminalParser</ProjectName>
<TargetName>ConTermParser</TargetName>
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props"/>
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<!-- ONLY ADD CLOSED-SOURCE FILES HERE, OPEN-SOURCE FILES GO IN parser-common.vcxitems -->
<Import Project="$(SolutionDir)src\terminal\parser\parser-common.vcxitems" />
<ItemGroup>

View file

@ -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

View file

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <precomp.h>
#include "precomp.h"
#include "telemetry.hpp"

View file

@ -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

View file

@ -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;
};
}

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\CodepointWidthDetector.cpp" />
<ClCompile Include="..\convert.cpp" />

View file

@ -9,6 +9,15 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(SolutionDir)src\common.build.pre.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>-O3 -Wno-microsoft-include -Wno-c++11-narrowing %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="../winconpty.cpp" />
<ClCompile Include="../precomp.cpp">

View file

@ -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 <ntstatus.h>
#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 <strsafe.h>
#include "../host/conddkrefs.h"