mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 10:49:11 +02:00
* set ConsoleStartupMode in all startup codes
git-svn-id: trunk@7274 -
This commit is contained in:
parent
b3b099f63c
commit
4e375e0c38
rtl/win32
@ -45,6 +45,12 @@ unit sysinitgprof;
|
||||
procedure CMainEXE;cdecl;forward;
|
||||
procedure CMainDLL;cdecl;forward;
|
||||
|
||||
const
|
||||
STD_INPUT_HANDLE = dword(-10);
|
||||
|
||||
function GetStdHandle(nStdHandle:DWORD) : THandle; stdcall; external 'kernel32' name 'GetStdHandle';
|
||||
function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): Boolean; stdcall; external 'kernel32' name 'GetConsoleMode';
|
||||
|
||||
procedure EXEgmon_start;
|
||||
begin
|
||||
if monstarted=0 then
|
||||
@ -96,6 +102,10 @@ unit sysinitgprof;
|
||||
subl $0x8,%esp
|
||||
andl $0xfffffff0,%esp
|
||||
end;
|
||||
{ it seems cygwin messed around with the console mode so we've to
|
||||
store the startup console mode before cygwin can do anything (FK)
|
||||
}
|
||||
GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode);
|
||||
Cygwin_crt0(@CMainEXE);
|
||||
end;
|
||||
|
||||
|
@ -25,10 +25,17 @@ unit sysinitpas;
|
||||
procedure EXE_Entry; external name '_FPC_EXE_Entry';
|
||||
function DLL_entry : longbool; external name '_FPC_DLL_Entry';
|
||||
|
||||
const
|
||||
STD_INPUT_HANDLE = dword(-10);
|
||||
|
||||
function GetStdHandle(nStdHandle:DWORD) : THandle; stdcall; external 'kernel32' name 'GetStdHandle';
|
||||
function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): Boolean; stdcall; external 'kernel32' name 'GetConsoleMode';
|
||||
|
||||
procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
|
||||
begin
|
||||
IsConsole:=true;
|
||||
{ do it like it is necessary for the startup code linking against cygwin }
|
||||
GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode);
|
||||
Exe_entry;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user