Subject: Re: [ruby-ffi] Describing an anonymous union |
From: Wayne Meissner |
Date: 10/13/13 7:43 PM |
To: ruby-ffi@googlegroups.com |
Usually I just come up with some name for anonymous structs/unions. However, I wonder if you could do
layout :type, :uade_notification_type, :union, Class.new(FFI::Union).class_
eval do ... end or something similar?
On 10/12/2013 04:44 AM, Misty De Meo wrote:
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+u...@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
-- Blog: http://postmodern.github.com/ GitHub: https://github.com/postmodern Twitter: @postmodern_mod3 PGP: 0xB9515E77