Oxygen Basic
Programming => Bugs & Feature Requests => Topic started by: Brian Alvarez on May 14, 2019, 10:31:24 PM
-
Hello Charles, sorry to bother, i just want to help Oxygen to get better. :)
In 32bit mode, this code compiles and works fine, but
try this in 64 bit mode and it fails at compilation.
I have this TYPE:
TYPE THREADVAR_PTR
QUAD addr
=
DWORD upper
DWORD lower
END TYPE
When i define a THREADVAR_PTR variable like this:
THREADVAR_PTR tp
And then use it like this:
tp.addr = getmemory(sizeof(dtype))
I get this when i try to compile:
Linker found unidentified names:
364 fildqword "main source
When i edit the TYPE like this:
TYPE THREADVAR_PTR
SYS addr
DWORD dummy ' add some extra dummy bytes in case of 32 bit.
=
DWORD upper
DWORD lower
END TYPE
Everything compiles fine.
I think it should be an easy fix, right?
-
Thanks Brian,
I will investigate.
You won't need the dummy, and lower comes before upper in little-endian x86:
TYPE THREADVAR_PTR
SYS addr
=
DWORD lower
DWORD upper
-
Cool, Thanks Charles. I thought that since SYS is 32 bits in x32 mode, the second dword would overflow the type.
Its good to know it wont...
So, the bigger blocks defines the size of the UDT, right?
-
Yes, unions are always padded out to the max.