From 8aca5d924f1efb96e5de89ffb21ec0c85b8ff560 Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 2 Dec 2002 13:58:29 +0000 Subject: [PATCH] * avoid longjmp messages if quitting after compilation error --- ide/fpcompil.pas | 18 ++++++++++++++---- ide/test.pas | 15 +++++++++++++++ ide/test2.pas | 3 ++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/ide/fpcompil.pas b/ide/fpcompil.pas index 02689f4db3..b9553c0375 100644 --- a/ide/fpcompil.pas +++ b/ide/fpcompil.pas @@ -661,12 +661,15 @@ begin CompilerStatus:=false; end; +const + LONGJMPCALLED = -1; + procedure CompilerStop; {$ifndef FPC}far;{$endif} begin {$ifndef GABOR} {$ifdef HasSignal} if StopJmpValid then - Longjmp(StopJmp,1) + Longjmp(StopJmp,LONGJMPCALLED) else Halt(1); {$endif} @@ -988,6 +991,7 @@ begin Inc(status.errorCount); {$ifdef HasSignal} Case JmpRet of + LONGJMPCALLED : s:='Error'; SIGINT : s := 'Interrupted by Ctrl-C'; SIGILL : s := 'Illegal instruction'; SIGSEGV : s := 'Signal Segmentation violation'; @@ -997,8 +1001,11 @@ begin end; CompilerMessageWindow^.AddMessage(V_error,s+' during compilation','',0,0); {$endif HasSignal} - CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0); - SetStatus('Long jumped out of compilation...'); + if JmpRet<>LONGJMPCALLED then + begin + CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0); + SetStatus('Long jumped out of compilation...'); + end; end; {$ifdef HasSignal} StopJmpValid:=StoreStopJumpValid; @@ -1315,7 +1322,10 @@ end; end. { $Log$ - Revision 1.17 2002-11-20 17:35:00 pierre + Revision 1.18 2002-12-02 13:58:29 pierre + * avoid longjmp messages if quitting after compilation error + + Revision 1.17 2002/11/20 17:35:00 pierre * use target_os.ExeExt for compiled executable Revision 1.16 2002/10/23 19:19:40 hajny diff --git a/ide/test.pas b/ide/test.pas index e7ced43333..98e8925cb6 100644 --- a/ide/test.pas +++ b/ide/test.pas @@ -157,7 +157,22 @@ var i : longint; Length : longint; BEGIN +{$ifdef m68k} + asm + beq @L13 + bhi @L13 + blo @L13 + dbeq d0,@L13 + dbcs d0,@L13 + // dblo d0,@L13 +@L13: + end; +{$endif} ClassVar1:=TClass2.create; + Obj1.Init; + pointer2:=@Obj1; + Writeln('Obj1.Z=',Obj1.Z); + Obj1.done; X:=nil; // fg for i:=1 to 2000 do diff --git a/ide/test2.pas b/ide/test2.pas index de382b9d7e..bfefa25d55 100644 --- a/ide/test2.pas +++ b/ide/test2.pas @@ -21,7 +21,8 @@ function IsOdd(X: integer): boolean; var Z: byte; begin Z:=0; - X:=Z*X{$ifdef i386}*Test8087{$endif}; + X:=Z*X{$ifdef cpui386}* + Test8087{$endif}; IsOdd:=(X mod 2)=1; end;