On 21/08/2012 07:41, Pierre-Alain Bourdil wrote:

Hi,

the structure is pretty simple :

// This is a STRUCT3
struct A {...}

struct B {
    enum {E1,E2} kind // ok for mapping enum
    union {
       int64_t ref ; // there was a discussion about int64 platform independant 
conversion. I just defined a Cint64_t as Clong
       struct A *a;
    } arg
}


As i explained, my problem is to differentiate int64_t from Cpointer Cstruct  
in my vol2enum function..

Presumably at the level of struct B you can distinguish them depending on the value of "kind". Maybe you can represent struct B as an ML value and provide a conversion between those. It would require a bit of care especially as I'm not exactly clear about the alignment requirements for "arg" if you want this to run on both 32-bits and 64-bits.

David

_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to