81
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on April 09, 2024, 12:46:41 AM »Based on what I've read it looks like long is 32 bit on Windows 64 bit compiled C code. One would have to use long long for 64 bit values. It looks to me like a major refactoring job of the code. I'm hoping someone comes up which a better story.
[32-bit Linux]
me@u32:~$ ./sizes32
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 4
sizeof(long long): 8
[64-bit Linux]
me@u64:~$ ./sizes64
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 8
sizeof(long long): 8
[32-bit Windows]
C:\Users\me\Downloads>sizes32.exe
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 4
sizeof(long long): 8
[64-bit Windows]
C:\Users\me\Downloads>sizes64.exe
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 4
sizeof(long long): 8
Based on Linux LONG being 8 bytes wide and ScriptBasic working fine, defining LONG as long long would probably work but break interfacing with other 64 bit libraries passing 4 byte longs.
[32-bit Linux]
me@u32:~$ ./sizes32
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 4
sizeof(long long): 8
[64-bit Linux]
me@u64:~$ ./sizes64
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 8
sizeof(long long): 8
[32-bit Windows]
C:\Users\me\Downloads>sizes32.exe
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 4
sizeof(long long): 8
[64-bit Windows]
C:\Users\me\Downloads>sizes64.exe
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long): 4
sizeof(long long): 8
Based on Linux LONG being 8 bytes wide and ScriptBasic working fine, defining LONG as long long would probably work but break interfacing with other 64 bit libraries passing 4 byte longs.
Quote
Windows x64 is a hybrid operating system, meaning many components (e.g. Internet Explorer, Windows Media Player, etc.) are present in both 32bit and 64bit variants and most 32bit programs work just as well with Windows x64.
is it worth to change? only if you have more than 4 GB RAM in your system.