Adam Naumowicz wrote:
Hello,
I've tried to compile the following code with --delphi option toggled on, but the compiler reported tester.pas:17: error: reference expected, value given
program tester; uses gpc;
procedure CatchSignal(aSig : Integer); begin case aSig of 2, 3, 15 : {SigInt, SigQuit, SigTerm} begin end; end; end;
var OldSigInt : TSignalHandler; r,dummy:boolean;
begin
r:=InstallSignalHandler(SigInt,CatchSignal,true,false,OldSigInt,dummy); end.
Then I checked the declaration of InstallSignalHandler and tried the same with aSig's type changed to CInteger. It compiled fine, except when the --delphi switch was on, because then CInteger seemed to be unknown ;-(
Do you have any suggestions how to fix this problem?
Well, InstallSignalHandler is not Delphi compatible, so you can't expect to be able to use it in `--delphi' mode.
You can turn if off locally (`{$gnu-pascal}'), either for the call, or while declaring a new type equivalent to `CInteger'.
Frank