Skip to content

Cannot use union members #192

Open
Open
@IbrahimaWane

Description

@IbrahimaWane

Hello,
I have a lot of C code to convert to Scala-native - a library actually.
However, some of the types are not correctly generated. This is an example:

typedef struct iodbto {
    short   datano_s ;
    short   type ;   
    short   datano_e ; 
    union {
        long    m_ofs[5] ;     
        long    m_ofs_a[5] ;   
        long    m_ofs_b[10] ;   
        long    m_ofs_c[20] ;   
        struct  {
            short   tip ; //THIS GUY for example, is not accessible through the **_N** 
            long    data[1] ;
        } m_ofs_at[5] ;       
        struct  {
            short   tip ;
            long    data[2] ;
        } m_ofs_bt[5] ;         
        struct  {
            short   tip ;
            long    data[4] ;
        } m_ofs_ct[5] ;         
        short   t_tip[5] ;     
        long    t_ofs[5] ;     
        struct  {
            short   tip ;
            long    data[4] ;
        } t_ofs_a[5] ;       
        struct {
            short   tip ;
            long    data[8] ;
        } t_ofs_b[5] ;        
        long    t_ofs_2g[15];  
        long    m_ofs_cnr[10];  
        struct  {
                long    data[2];
        } t_ofs_ex[5];		   
    } u ;   
} IODBTO ;

Without using the generated implicit classes, I cannot access the variables inside the structs in the union.
As for using the implicits, some parts are not correctly generated:

screenshot1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions