* set ConsoleStartupMode in all startup codes

git-svn-id: trunk@7274 -
This commit is contained in:
florian 2007-05-05 15:33:34 +00:00
parent b3b099f63c
commit 4e375e0c38
2 changed files with 17 additions and 0 deletions

View File

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

View File

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