Converting Fuse headers
div0
div0 at sourceforge.net
Wed Nov 10 13:19:46 PST 2010
On 10/11/2010 21:02, Jesse Phillips wrote:
> div0 Wrote:
>
>> You can still do the size check for the stat_t struct as well,
>> I always double check the size of structs when doing those conversions
>> as it's very easy to get it wrong.
>
> Ah, good idea. The test I have planned will be to set some values in the D struct, and see what is read by the C struct. The size thing will definitely be a simple give away if it differs.
>
> I might try to use some reflection to see what the structure D creates looks like, so that it will be easier to compare the D code with the C header. (Lots of version statements in the D version, might be some macros in C too.)
Also another thing to make life easier, use gcc's only preprocess the
file option (-E ?) and save the result. That way you can look at the raw
struct after all the CPP macros have been applied/stripped out.
That's very handy with complicated C structs.
--
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
More information about the Digitalmars-d-learn
mailing list