[Gambas-user] Moving from 64bit to 32 bit and back
brian at westwoodsvcs.com
Sat Jul 4 01:48:38 CEST 2020
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.
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.
>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.
>>----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User