M
morbidpriest
Hello folks,
I need to define 64 bit pointers in C structs that are going to be
common to 32 bit and 64 bit platforms. I need the layout of all the
variables in the structure to be 100% consistent between architectures.
Basically I want a way to pad out the pointer variables so that they
will always be 64 bit in length, even when compiled in a 32 bit
environment.
Microsoft have a solution to this in the form of __ptr64.
Unfortunately GCC does not seem to have this feature - the closest I
could find is __attribute__ ((aligned (8))). This seemed like a good
idea initially but it's not the same thing, given that the variables
need to be padded out, aligning them does not really give the correct
result (I tried and failed).
So does anyone have any suggestions on how to emulate __ptr64 in GCC as
cleanly as possible, I have been trying and am completely out of ideas
at this point...
I need to define 64 bit pointers in C structs that are going to be
common to 32 bit and 64 bit platforms. I need the layout of all the
variables in the structure to be 100% consistent between architectures.
Basically I want a way to pad out the pointer variables so that they
will always be 64 bit in length, even when compiled in a 32 bit
environment.
Microsoft have a solution to this in the form of __ptr64.
Unfortunately GCC does not seem to have this feature - the closest I
could find is __attribute__ ((aligned (8))). This seemed like a good
idea initially but it's not the same thing, given that the variables
need to be padded out, aligning them does not really give the correct
result (I tried and failed).
So does anyone have any suggestions on how to emulate __ptr64 in GCC as
cleanly as possible, I have been trying and am completely out of ideas
at this point...