[Gambas-user] Moving from 64bit to 32 bit and back

Jussi Lahtinen jussi.lahtinen at gmail.com
Sun Jul 5 00:23:54 CEST 2020


Err... the bits are in wrong way.


Jussi

On Sun, Jul 5, 2020 at 1:22 AM Jussi Lahtinen <jussi.lahtinen at gmail.com>
wrote:

> You don't have to make the choice everytime, only once.
>
> If System.Architecture = "x86_64" Then
> hClassToBeUsed = 32bitClass
> Else
> hClassToBeUsed = 64bitClass
> Endif
>
> hClassToBeUsed.Somefunction()
>
>
> Jussi
>
> On Sat, Jul 4, 2020 at 6:22 AM Brian G <brian at westwoodsvcs.com> wrote:
>
>> So put every extern into two classes and then choose the one to use each
>> time
>>
>> --
>> Thanks
>> Brian
>> Friday, 03 July 2020, 05:17PM -07:00 from Jussi Lahtinen
>> jussi.lahtinen at gmail.com:
>>
>> Then perhaps one alternative would be different classes for 32 and 64 bit
>> systems and choose which one to use according to what System.Architecture
>> returns at runtime.
>>
>> Jussi
>>
>> On Sat, Jul 4, 2020 at 2:59 AM Brian G <brian at westwoodsvcs.com> wrote:
>>
>> Yes that would work, but then I have to figure out the address width
>> myself at compile time.
>>
>>    I would need to compile for each architecture .
>>
>>   I was trying to find a way to make the code portable that requires no
>> recompile for SAME OS 32 AND 64 BIT VERSION. The same package can be
>> installed on both versions and call c functions and pass structures without
>> any issues....... So far lol  ... with such in-depth testing I have done...
>> Three or four times ...
>>
>> Pointers are basically unsigned values which match size_t's nominal type
>> and length.
>>
>> The cint and clong function are signed so it does take a little bit if
>> fiddling to work properly.
>>
>> More testing needed of course.
>>
>> --
>> Thanks
>> Brian
>> Friday, 03 July 2020, 01:40PM -07:00 from Jussi Lahtinen
>> jussi.lahtinen at gmail.com:
>>
>> I would rather use preprocessors to define the variables, but it
>> depends... your way should work.
>> http://gambaswiki.org/wiki/lang/.if
>>
>> Jussi
>>
>> On Fri, Jul 3, 2020 at 4:51 AM Brian G <brian at westwoodsvcs.com> wrote:
>>
>> I replaced all c calls from Gambas3 that required Size_t data type with a
>> pointer type in Gambas and cast the type using cint() or clong() when the
>> value must be used.
>>
>> I did this because in most cases size_t follows the width of the address
>> bus by convention.
>>
>> This seems to work so far.
>>
>> Does anyone have any thoughts on this?
>>
>> I would like to get some input about this if anyone have a better idea
>>
>> I can't see any where even in the structures I have used that this does
>> not translate well.
>>
>> Was playing with the new raspi OS which defaults to 32 bit.
>>
>> Thank You
>> Brian G
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200705/96ab0486/attachment-0001.html>


More information about the User mailing list