mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:05:57 +02:00
fix for bug #1487
This commit is contained in:
parent
96dd41ac38
commit
529f063fc5
@ -389,6 +389,13 @@ begin
|
|||||||
if AClass>=V_Info then
|
if AClass>=V_Info then
|
||||||
Line:=0;
|
Line:=0;
|
||||||
MsgLB^.AddItem(New(PCompilerMessage,Init(AClass, Msg, MsgLB^.AddModuleName(Module), Line, Column)));
|
MsgLB^.AddItem(New(PCompilerMessage,Init(AClass, Msg, MsgLB^.AddModuleName(Module), Line, Column)));
|
||||||
|
if (@Self=CompilerMessageWindow) and (AClass in [V_fatal,V_Error]) then
|
||||||
|
begin
|
||||||
|
if not GetState(sfVisible) then
|
||||||
|
Show;
|
||||||
|
if Desktop^.First<>PView(CompilerMessageWindow) then
|
||||||
|
MakeFirst;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1022,7 +1029,7 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
PopStatus;
|
PopStatus;
|
||||||
{ Set end status }
|
{ Set end status }
|
||||||
if CompilationPhase<>cpAborted then
|
if not (CompilationPhase in [cpAborted,cpFailed]) then
|
||||||
if (status.errorCount=0) then
|
if (status.errorCount=0) then
|
||||||
CompilationPhase:=cpDone
|
CompilationPhase:=cpDone
|
||||||
else
|
else
|
||||||
@ -1248,7 +1255,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2001-09-18 11:33:26 pierre
|
Revision 1.5 2001-10-03 10:21:43 pierre
|
||||||
|
fix for bug 1487
|
||||||
|
|
||||||
|
Revision 1.4 2001/09/18 11:33:26 pierre
|
||||||
* fix bug 1604
|
* fix bug 1604
|
||||||
|
|
||||||
Revision 1.3 2001/09/12 09:25:01 pierre
|
Revision 1.3 2001/09/12 09:25:01 pierre
|
||||||
|
@ -16,6 +16,13 @@
|
|||||||
{$i globdir.inc}
|
{$i globdir.inc}
|
||||||
|
|
||||||
unit FPIntf;
|
unit FPIntf;
|
||||||
|
|
||||||
|
{$ifdef FPC}
|
||||||
|
{$ifndef COMPILER_1_0}
|
||||||
|
{$mode objfpc}
|
||||||
|
{$endif COMPILER_1_0}
|
||||||
|
{$endif FPC}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{ Run }
|
{ Run }
|
||||||
@ -34,11 +41,14 @@ function version_string : string;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Compiler,
|
Compiler,Comphook,
|
||||||
|
{$ifdef COMPILER_1_0}
|
||||||
|
tpexcept,
|
||||||
|
{$endif COMPILER_1_0}
|
||||||
{$ifndef NODEBUG}
|
{$ifndef NODEBUG}
|
||||||
FPDebug,
|
FPDebug,
|
||||||
{$endif NODEBUG}
|
{$endif NODEBUG}
|
||||||
FPRedir,FPVars,
|
FPRedir,FPVars,FpCompil,
|
||||||
FPUtils,FPSwitch,WUtils;
|
FPUtils,FPSwitch,WUtils;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
@ -72,9 +82,19 @@ end;
|
|||||||
Compile
|
Compile
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
|
var
|
||||||
|
CatchErrorLongJumpBuffer : jmp_buf;
|
||||||
|
|
||||||
|
procedure CatchCompilationErrors;
|
||||||
|
begin
|
||||||
|
LongJmp(CatchErrorLongJumpBuffer,1);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure Compile(const FileName, ConfigFile: string);
|
procedure Compile(const FileName, ConfigFile: string);
|
||||||
var
|
var
|
||||||
cmd : string;
|
cmd : string;
|
||||||
|
ExitReason : integer;
|
||||||
|
ExitAddr,StoreExitProc : pointer;
|
||||||
{$ifdef USE_EXTERNAL_COMPILER}
|
{$ifdef USE_EXTERNAL_COMPILER}
|
||||||
CompilerOut : Text;
|
CompilerOut : Text;
|
||||||
CompilerOutputLine : longint;
|
CompilerOutputLine : longint;
|
||||||
@ -177,7 +197,44 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif USE_EXTERNAL_COMPILER}
|
{$endif USE_EXTERNAL_COMPILER}
|
||||||
Compiler.Compile(cmd);
|
begin
|
||||||
|
{$ifdef COMPILER_1_0}
|
||||||
|
storeexitproc:=exitproc;
|
||||||
|
if SetJmp(CatchErrorLongJumpBuffer)=0 then
|
||||||
|
begin
|
||||||
|
exitproc:=@CatchCompilationErrors;
|
||||||
|
{$else : not COMPILER_1_0}
|
||||||
|
try
|
||||||
|
{$endif COMPILER_1_0}
|
||||||
|
Compiler.Compile(cmd);
|
||||||
|
{$ifdef COMPILER_1_0}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
ExitReason:=ExitCode;
|
||||||
|
ExitCode:=0;
|
||||||
|
ErrorCode:=0;
|
||||||
|
ExitAddr:=ErrorAddr;
|
||||||
|
ErrorAddr:=nil;
|
||||||
|
CompilationPhase:=cpFailed;
|
||||||
|
{ FIXME: this is not 64bit compatible PM }
|
||||||
|
CompilerMessageWindow^.AddMessage(V_Error,
|
||||||
|
'Compiler exited with error '+inttostr(ExitReason)+
|
||||||
|
' at addr '+inttohex(longint(ExitAddr),8),'',0,0);
|
||||||
|
end;
|
||||||
|
exitproc:=storeexitproc;
|
||||||
|
{$else : not COMPILER_1_0}
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
begin
|
||||||
|
CompilationPhase:=cpFailed;
|
||||||
|
CompilerMessageWindow^.AddMessage(V_Error,
|
||||||
|
'Compiler exited','',0,0);
|
||||||
|
CompilerMessageWindow^.AddMessage(V_Error,
|
||||||
|
e.message,'',0,0);
|
||||||
|
end;
|
||||||
|
{$endif COMPILER_1_0}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef USE_EXTERNAL_COMPILER}
|
{$ifdef USE_EXTERNAL_COMPILER}
|
||||||
@ -231,7 +288,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2001-08-04 11:30:23 peter
|
Revision 1.2 2001-10-03 10:21:43 pierre
|
||||||
|
fix for bug 1487
|
||||||
|
|
||||||
|
Revision 1.1 2001/08/04 11:30:23 peter
|
||||||
* ide works now with both compiler versions
|
* ide works now with both compiler versions
|
||||||
|
|
||||||
Revision 1.1.2.3 2001/03/08 16:40:07 pierre
|
Revision 1.1.2.3 2001/03/08 16:40:07 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user