[fpc-pascal] Type helper for JNI pointers

Andrew Haines andrewd207 at aol.com
Thu Aug 23 04:23:13 CEST 2018



On 08/12/2018 07:42 AM, Benito van der Zander wrote:
>
>
> But this does not work, because fpc thinks jclass and jobject are the 
> same type, so there is only one type helper for both of the types allowed.
>
> Because it is declared as
>
> type
>      jobject=pointer;
>      jclass=jobject;
>
>
> What can we do about this?
>
I haven't used type helpers but why not change to defines like

type
   jObjectRec = record end;
   jObject= ^jObjectRec;
   jClassRec = record end;
   jClass = ^jClassRec;

or possibly simpler you could try
   jclass = type(jobject); // I believe this forces a new type and is 
not just an alias

Regards,

Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180822/78d86610/attachment.html>


More information about the fpc-pascal mailing list