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 -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8