mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 08:46:09 +02:00
* set ConsoleStartupMode in all startup codes
git-svn-id: trunk@7274 -
This commit is contained in:
parent
b3b099f63c
commit
4e375e0c38
@ -45,6 +45,12 @@ unit sysinitgprof;
|
|||||||
procedure CMainEXE;cdecl;forward;
|
procedure CMainEXE;cdecl;forward;
|
||||||
procedure CMainDLL;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;
|
procedure EXEgmon_start;
|
||||||
begin
|
begin
|
||||||
if monstarted=0 then
|
if monstarted=0 then
|
||||||
@ -96,6 +102,10 @@ unit sysinitgprof;
|
|||||||
subl $0x8,%esp
|
subl $0x8,%esp
|
||||||
andl $0xfffffff0,%esp
|
andl $0xfffffff0,%esp
|
||||||
end;
|
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);
|
Cygwin_crt0(@CMainEXE);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -25,10 +25,17 @@ unit sysinitpas;
|
|||||||
procedure EXE_Entry; external name '_FPC_EXE_Entry';
|
procedure EXE_Entry; external name '_FPC_EXE_Entry';
|
||||||
function DLL_entry : longbool; external name '_FPC_DLL_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';
|
procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
|
||||||
begin
|
begin
|
||||||
IsConsole:=true;
|
IsConsole:=true;
|
||||||
|
{ do it like it is necessary for the startup code linking against cygwin }
|
||||||
|
GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode);
|
||||||
Exe_entry;
|
Exe_entry;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user