Wei Liu writes ("[PATCH v2] libs/gnttab: introduce XENGNTTAB_BUILD_BUG_ON"):
> The implementation is taken from libxc.
> I could have put it in a header file accessible to all libraries under
> libs but this construct is only relevant to xengnttab library at the
> moment so it's put under gnttab/private.h. It can be easily moved to
> a common place when other libraries under libs require it.

Other bits of tools already have this:

mariner:xen.git> git-grep -i 'define.*build_bug' tools | cat
tools/firmware/hvmloader/util.h:#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 
2 * !!(p)]))
tools/libxc/xc_private.h:#define XC_BUILD_BUG_ON(p) ({ _Static_assert(!(p), 
"!(" #p ")"); })
tools/libxc/xc_private.h:#define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { 
int:-!!(p); }))
tools/libxl/libxl_internal.h:#define BUILD_BUG_ON(p) ({ _Static_assert(!(p), 
"!(" #p ")"); })
tools/libxl/libxl_internal.h:#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * 

Do we really need to introduce yet another copy of this ?  Is gnttab
not allowed to include xc_private.h ?  Is there not some one place
where we could put this ?


Xen-devel mailing list

Reply via email to