On 12/10/19 3:47 PM, Nick Rosbrook wrote:
> From: Nick Rosbrook <rosbro...@ainfosec.com>
> 
> Switch over union key to determine how to populate 'union' in Go struct.
> 
> Since the unions of C types cannot be directly accessed in cgo, use a
> typeof trick to typedef a struct in the cgo preamble that is analagous
> to each inner struct of a keyed union. For example, to define a struct
> for the hvm inner struct of libxl_domain_build_info, do:
> 
>   typedef typeof(((struct libxl_domain_build_info *)NULL)->u.hvm) 
> libxl_domain_build_info_type_union_hvm;
> 
> Signed-off-by: Nick Rosbrook <rosbro...@ainfosec.com>

Looks great, thanks:

Reviewed-by: George Dunlap <george.dun...@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to