Build terminal faster

This avoids including rpc module from windows which takes 200ms to build
This commit is contained in:
Marcelo Silva Nascimento Mancini 2023-09-28 07:58:17 -03:00 committed by GitHub
parent 2433b60d91
commit aa5f26f055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -318,7 +318,12 @@ version(TerminalDirectToEmulator) {
}
version(Windows)
import core.sys.windows.windows;
{
import core.sys.windows.wincon;
import core.sys.windows.winnt;
import core.sys.windows.winbase;
import core.sys.windows.winuser;
}
version(Win32Console) {
private {
@ -8490,7 +8495,9 @@ version(TerminalDirectToEmulator) {
//pthread_cancel(widget.term.threadId);
//widget.term = null;
} else version(Windows) {
import core.sys.windows.windows;
import core.sys.windows.winbase : OpenProcess, TerminateProcess, GetCurrentProcessId;
import core.sys.windows.winnt :SYNCHRONIZE, PROCESS_TERMINATE, TRUE;
auto hnd = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, TRUE, GetCurrentProcessId());
TerminateProcess(hnd, -1);
assert(0);
@ -9490,7 +9497,8 @@ void main() {
private version(Windows) {
pragma(lib, "user32");
import core.sys.windows.windows;
import core.sys.windows.winbase : CreateNamedPipeA;
import core.sys.windows.winnt: HANDLE, DWORD, LPSECURITY_ATTRIBUTES;
extern(Windows)
HANDLE CreateNamedPipeA(