mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 19:12:25 +00:00
Fix mingw where ENABLE_VIRTUAL_TERMINAL_PROCESSING is undefined.
This commit is contained in:
parent
2cd28725ea
commit
9f5d4c6b0d
3 changed files with 10 additions and 12 deletions
|
|
@ -119,13 +119,12 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
|
|||
#define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT
|
||||
#define Platform_ETIMEDOUT() WSAETIMEDOUT
|
||||
extern void Heap_InitHeap();
|
||||
#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m)
|
||||
#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m)
|
||||
#define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount()
|
||||
#define Platform_HeapInitHeap() Heap_InitHeap()
|
||||
#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m)
|
||||
#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m)
|
||||
#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h)
|
||||
#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h)
|
||||
#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||
#define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))
|
||||
#define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh
|
||||
#define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow
|
||||
|
|
@ -746,7 +745,7 @@ static void Platform_EnableVT100 (void)
|
|||
{
|
||||
INT32 mode;
|
||||
if (Platform_GetConsoleMode(Platform_StdOut, &mode)) {
|
||||
Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing());
|
||||
Platform_SetConsoleMode(Platform_StdOut, mode + 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,13 +119,12 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
|
|||
#define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT
|
||||
#define Platform_ETIMEDOUT() WSAETIMEDOUT
|
||||
extern void Heap_InitHeap();
|
||||
#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m)
|
||||
#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m)
|
||||
#define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount()
|
||||
#define Platform_HeapInitHeap() Heap_InitHeap()
|
||||
#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m)
|
||||
#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m)
|
||||
#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h)
|
||||
#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h)
|
||||
#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||
#define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))
|
||||
#define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh
|
||||
#define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow
|
||||
|
|
@ -746,7 +745,7 @@ static void Platform_EnableVT100 (void)
|
|||
{
|
||||
INT32 mode;
|
||||
if (Platform_GetConsoleMode(Platform_StdOut, &mode)) {
|
||||
Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing());
|
||||
Platform_SetConsoleMode(Platform_StdOut, mode + 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -587,13 +587,13 @@ PROCEDURE SetHalt*(p: HaltProcedure);
|
|||
BEGIN HaltHandler := p; END SetHalt;
|
||||
|
||||
|
||||
PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, m)";
|
||||
PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, m)";
|
||||
PROCEDURE -VTprocessing(): SYSTEM.INT32 "ENABLE_VIRTUAL_TERMINAL_PROCESSING";
|
||||
PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, (DWORD*)m)";
|
||||
PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, (DWORD)m)";
|
||||
|
||||
PROCEDURE EnableVT100;
|
||||
CONST VTprocessing = 4; (* ENABLE_VIRTUAL_TERMINAL_PROCESSING: value specified by MSDN *)
|
||||
VAR mode: SYSTEM.INT32;
|
||||
BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing()) END
|
||||
BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing) END
|
||||
END EnableVT100;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue