Re: [fpc-pascal] Variants with classes and records

2022-10-06 Thread Hairy Pixels via fpc-pascal


> On Oct 6, 2022, at 12:45 PM, Sven Barth  wrote:
> 
> Am 05.10.2022 um 14:16 schrieb Hairy Pixels via fpc-pascal:
>> Is it possible to assign a class to a variant? I tried and get a crash. If 
>> not, why not? It’s just a pointer so I would expect it to work.
> 
> There is no field that would hold a class reference and no type value that 
> would differentiate it, thus the code handling variants would not be able to 
> finalize (aka free) a class correctly. You can of course always use a custom 
> type and handle that yourself. *shrugs*

Oh so the problem is variant thinks it should try to manage memory for you? I 
tried doing:

  v: variant;
begin
  v := GetMem(100);

And that crashed also. I thought it would be ok to just hold the reference but 
not claim ownership over it.

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] iOS

2022-10-06 Thread Adriaan van Os via fpc-pascal



I would be pleased to know where I can find the latest iOS parsed headers and possibly a hello 
program. Also, the cross compilers for iOS don't seem to be available at 
 on any of the listed mirrors.


Regards,

Adriaan van Os

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Variants with classes and records

2022-10-06 Thread Sven Barth via fpc-pascal
Hairy Pixels  schrieb am Do., 6. Okt. 2022, 13:49:

>
>
> > On Oct 6, 2022, at 12:45 PM, Sven Barth 
> wrote:
> >
> > Am 05.10.2022 um 14:16 schrieb Hairy Pixels via fpc-pascal:
> >> Is it possible to assign a class to a variant? I tried and get a crash.
> If not, why not? It’s just a pointer so I would expect it to work.
> >
> > There is no field that would hold a class reference and no type value
> that would differentiate it, thus the code handling variants would not be
> able to finalize (aka free) a class correctly. You can of course always use
> a custom type and handle that yourself. *shrugs*
>
> Oh so the problem is variant thinks it should try to manage memory for
> you? I tried doing:
>
>   v: variant;
> begin
>   v := GetMem(100);
>
> And that crashed also. I thought it would be ok to just hold the reference
> but not claim ownership over it.
>

Variants count as managed types and they can contain interface references
and strings. If you use a custom type you can do as you please, but the
internal types that can be assigned to a Variant *are* managed accordingly
(if the types themselves are managed).

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread Hairy Pixels via fpc-pascal



> On Oct 6, 2022, at 7:12 PM, Adriaan van Os via fpc-pascal 
>  wrote:
> 
> I would be pleased to know where I can find the latest iOS parsed headers and 
> possibly a hello program. Also, the cross compilers for iOS don't seem to be 
> available at  on any of the listed 
> mirrors.

The last ones I did are ancient now at iOS 8 (where at 13 now!).

https://github.com/genericptr/iOS_8_0

Not sure if anyone else has bothered to update since then.

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread Hairy Pixels via fpc-pascal



> On Oct 6, 2022, at 7:12 PM, Adriaan van Os via fpc-pascal 
>  wrote:
> 
> I would be pleased to know where I can find the latest iOS parsed headers and 
> possibly a hello program. Also, the cross compilers for iOS don't seem to be 
> available at  on any of the listed 
> mirrors.

Looks like I made a little template project to get started with since I always 
forget this stuff myself.

https://github.com/genericptr/CocoaTouch-Pascal-Examples

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread Adriaan van Os via fpc-pascal



OK, thanks,

Adriaan van Os




On Oct 6, 2022, at 7:12 PM, Adriaan van Os via fpc-pascal 
 wrote:

I would be pleased to know where I can find the latest iOS parsed headers and 
possibly a hello program. Also, the cross compilers for iOS don't seem to be 
available at  on any of the listed 
mirrors.


The last ones I did are ancient now at iOS 8 (where at 13 now!).

https://github.com/genericptr/iOS_8_0

Not sure if anyone else has bothered to update since then.

Regards,
Ryan Joseph




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Variants with classes and records

2022-10-06 Thread Marco van de Voort via fpc-pascal


On 6-10-2022 14:16, Sven Barth via fpc-pascal wrote:


And that crashed also. I thought it would be ok to just hold the
reference but not claim ownership over it.


Variants count as managed types and they can contain interface 
references and strings. If you use a custom type you can do as you 
please, but the internal types that can be assigned to a Variant *are* 
managed accordingly (if the types themselves are managed).


(IIRC in case of native types there is another pointer in the variant 
which is an interface for something that manages the record.  But it has 
been a while)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread wkitty42--- via fpc-pascal

On 10/6/22 9:40 AM, Hairy Pixels via fpc-pascal wrote:

On Oct 6, 2022, at 7:12 PM, Adriaan van Os via fpc-pascal 
 wrote:

I would be pleased to know where I can find the latest iOS parsed headers
and possibly a hello program. Also, the cross compilers for iOS don't seem
to be available at  on any of the
listed mirrors. >

The last ones I did are ancient now at iOS 8 (where at 13 now!).
iOS 16 is out now... at least for iPhones... i currently have iOS 15.7 
installed... but maybe i'm misunderstanding something? idk...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list where it belongs!*
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread Jonas Maebe via fpc-pascal

On 06/10/2022 14:12, Adriaan van Os via fpc-pascal wrote:


Also, the cross compilers for iOS 
don't seem to be available at  
on any of the listed mirrors.


I indeed somehow forgot to upload that installer. I've uploaded it now 
to Sourceforge and to the main FPC download mirror.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread Jonas Maebe via fpc-pascal

On 06/10/2022 21:50, Jonas Maebe via fpc-pascal wrote:

On 06/10/2022 14:12, Adriaan van Os via fpc-pascal wrote:


Also, the cross compilers for iOS don't seem to be available at 
 on any of the listed mirrors.


I indeed somehow forgot to upload that installer. I've uploaded it now 
to Sourceforge and to the main FPC download mirror.


Never mind, I deleted them again. They contained FPC 3.2.0 installers, 
not 3.2.2 ones. I remember again that FPC 3.2.2 didn't build for iOS, 
and somehow I had accidentally packaged the 3.2.0 files in the 3.2.2 
installers. The building has been fixed on main IIRC, but I don't know 
if all necessary changes were merged back to the fixes branch.


Unless you need FPC 3.2.2-specific fixes, you can probably just use FPC 
3.2.0 instead for iOS.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] iOS

2022-10-06 Thread Hairy Pixels via fpc-pascal


> On Oct 6, 2022, at 10:27 PM, wkitty42--- via fpc-pascal 
>  wrote:
> 
>> The last ones I did are ancient now at iOS 8 (where at 13 now!).
> iOS 16 is out now... at least for iPhones... i currently have iOS 15.7 
> installed... but maybe i'm misunderstanding something? idk...

Typo, that’s the macOS version!

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal