Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use union members #192

Open
IbrahimaWane opened this issue May 16, 2019 · 0 comments
Open

Cannot use union members #192

IbrahimaWane opened this issue May 16, 2019 · 0 comments

Comments

@IbrahimaWane
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant