Subject:
[ruby-ffi] Describing an anonymous union
From:
Misty De Meo
Date:
10/12/13 6:44 AM
To:
ruby-ffi@googlegroups.com

How can I represent an anonymous union in FFI?

A struct I'm wrapping has the following structure:

struct uade_notification {
    enum uade_notification_type type;
    union {
        char *msg;
        struct uade_notification_song_end song_end;
    };
};

I can create a union using FFI::Union of course, but I'm not sure how to represent that in a struct layout. Is assigning it an arbitrary name the right way to go?

Best,
Misty

--
 
---
You received this message because you are subscribed to the Google Groups "ruby-ffi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-ffi+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.