Skip to content

Commit 718d7d0

Browse files
dragoss-yodaDHowett
authored andcommitted
Merged PR 12483430: build console* with clang
## Why is this change being made? ## What changed? ## How was the change tested? _For more information on the code review process, see the [Code Review Guidelines & Etiquette](https://aka.ms/codereviewguidelines)._ build console* with clang Related work items: #56630064
1 parent 7055b99 commit 718d7d0

File tree

7 files changed

+18
-5
lines changed

7 files changed

+18
-5
lines changed

src/host/directio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ CATCH_RETURN();
281281
// If .AsciiChar and .UnicodeChar have the same offset (since they're a union),
282282
// we can just write the latter with a byte-sized value to set the former
283283
// _and_ simultaneously clear the upper byte of .UnicodeChar to 0. Nice!
284-
static_assert(offsetof(CHAR_INFO, Char.AsciiChar) == offsetof(CHAR_INFO, Char.UnicodeChar));
284+
static_assert(__builtin_offsetof(CHAR_INFO, Char.AsciiChar) == __builtin_offsetof(CHAR_INFO, Char.UnicodeChar));
285285

286286
// Any time we see the lead flag, we presume there will be a trailing one following it.
287287
// Giving us two bytes of space (one per cell in the ascii part of the character union)

src/host/exe/lto_symbols.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LLVM_LTO_EXPORTED_SYMBOLS = \
2+
_tlgDefineProvider_annotation__Tlgg_ConhostLauncherProviderProv \
3+
wWinMain \

src/host/exe/sources

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
!include $(BASEDIR)\onecore\windows\core\console\console_clang_feature.inc
2+
13
!include ..\sources.inc
24
# -------------------------------------
35
# Windows Console
@@ -20,6 +22,10 @@ UMTYPE = windows
2022
UMENTRY = wwinmain
2123
TARGET_DESTINATION = retail
2224

25+
!if "$(CLANG_LTO)" == "1"
26+
!include lto_symbols.inc
27+
!endif
28+
2329
# -------------------------------------
2430
# Build System Settings
2531
# -------------------------------------

src/host/sources.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ SOURCES = \
8989
# Sources, Headers, and Libraries
9090
# -------------------------------------
9191

92+
!if "$(USE_CLANG)" != "1"
9293
PRECOMPILED_CXX = 1
9394
PRECOMPILED_INCLUDE = ..\precomp.h
9495
PRECOMPILED_PCH = precomp.pch
9596
PRECOMPILED_OBJ = precomp.obj
97+
!endif
9698

9799
INCLUDES = \
98100
$(INCLUDES); \

src/host/writeData.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class WriteData : public IWaitRoutine
4040
_Out_ NTSTATUS* const pReplyStatus,
4141
_Out_ size_t* const pNumBytes,
4242
_Out_ DWORD* const pControlKeyState,
43-
_Out_ void* const pOutputData);
43+
_Out_ void* const pOutputData) override;
4444

4545
private:
4646
SCREEN_INFORMATION& _siContext;

src/inc/LibraryIncludes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@
101101
// The compiler doesn't like that. --> Suppress the warning.
102102
#pragma warning(push)
103103
#pragma warning(disable: 4324) // structure was padded due to alignment specifier
104+
// undefine BUILD_WINDOWS so that wrl/event.h doesn't include wrl/internalevent.h
105+
#undef BUILD_WINDOWS
104106
#include <wrl.h>
105107
#pragma warning(pop)
106108

src/interactivity/win32/ConsoleControl.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ namespace Microsoft::Console::Interactivity::Win32
4545
};
4646

4747
// IConsoleControl Members
48-
[[nodiscard]] NTSTATUS NotifyConsoleApplication(_In_ DWORD dwProcessId);
49-
[[nodiscard]] NTSTATUS SetForeground(_In_ HANDLE hProcess, _In_ BOOL fForeground);
50-
[[nodiscard]] NTSTATUS EndTask(_In_ DWORD dwProcessId, _In_ DWORD dwEventType, _In_ ULONG ulCtrlFlags);
48+
[[nodiscard]] NTSTATUS NotifyConsoleApplication(_In_ DWORD dwProcessId) override;
49+
[[nodiscard]] NTSTATUS SetForeground(_In_ HANDLE hProcess, _In_ BOOL fForeground) override;
50+
[[nodiscard]] NTSTATUS EndTask(_In_ DWORD dwProcessId, _In_ DWORD dwEventType, _In_ ULONG ulCtrlFlags) override;
5151
[[nodiscard]] NTSTATUS SetWindowOwner(HWND hwnd, DWORD processId, DWORD threadId) noexcept override;
5252

5353
// Public Members

0 commit comments

Comments
 (0)