[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 3/5] libxl: add support for FreeBSD uuid implementation
On 19/06/14 17:32, Roger Pau Monne wrote: > Add the FreeBSD specific uuid implementation. Since uuid_t is not > defined as an array, but as a struct on FreeBSD, use a union with a > array in order to be able to return the uuid as a bytearray. > > Also, added a libxl internal compile time assert macro, that is used > to assert that the size of uuid_t is the same as the union used in > libxl. > > Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx> > Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> > Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> > --- > Changes since v2: > - Unify the FreeBSD and NetBSD uuid implementations as much as > possible. > --- > tools/libxl/libxl_internal.h | 4 ++++ > tools/libxl/libxl_uuid.c | 40 ++++++++++++++++++++++++++++++++-------- > tools/libxl/libxl_uuid.h | 12 +++++++----- > 3 files changed, 43 insertions(+), 13 deletions(-) > > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index a0d4f24..0784403 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -3179,6 +3179,10 @@ int libxl__uint64_parse_json(libxl__gc *gc, const > libxl__json_object *o, > void *p); > int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o, > char **p); > +/* > + * Compile time assertion > + */ > +#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)])) > Please prefer _Static_assert if available. c/s d5a3bc1a214 is the way I did this for libxc. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |