[fpc-devel] c-blocks (darwin aarch64)

Dmitry Boyarintsev skalogryz.lists at gmail.com
Sat Apr 16 21:35:18 CEST 2016


On Sat, Apr 16, 2016 at 3:05 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>
wrote:

> Using r33526, the app crashes with compiler native blocks at the same
>> spot (on calling set block handler)
>>
>
> Can you share code that crashes?


uses
  .. GameController // from iOS headers

procedure extendedGamePadChange(gamepad: GCExtendedGamepad; element:
GCControllerElement);
begin
  writeln('extendedGamepad changed! ', PtrUint(gamepad),' element:
',element._classDescription.utf8string);
end;

function iOS_joy_Init : Byte;
var
  list : NSArray;
  i    : integer;
  obj  : NSObject;
  gc   : GCController;
  block : tblock;
begin
  list:=GCController.controllers;
  Result:=list.count;
  for i:=0 to Result-1 do begin
    gc:=GCController(list.objectAtIndex(i));
    gc.setPlayerIndex(GCControllerPlayerIndex1+i);
    if Assigned(gc.extendedGamepad) then begin
       gc.extendedGamepad.setValueChangedHandler(@extendedGamePadChange);
// <- crash line
    end;
  end;
end;

... or are you looking for the whole project?
I should be able to create a stand-alone sample for you. (that could be a
better basis for starting a bug report).

See http://clang.llvm.org/docs/Block-ABI-Apple.html#high-level
>
> Those fields only exist if bits 25 resp. 26 are set in the flags.


There's no real indication that these fields could physically omit. (unless
"IFF" or "optional helper fields" in comments actually mean that).

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160416/a3471e0f/attachment.html>


More information about the fpc-devel mailing list