tools: Move ARRAY_SIZE() into xen-tools/libs.h

xen-tools/libs.h currently contains a shared BUILD_BUG_ON() implementation and
is used by some tools.  Extend this to include ARRAY_SIZE and clean up all the
opencoding.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2018-07-04 17:25:37 +01:00
1 parent 8674b02374
commit e1b7eb92d3
16 files changed
+24 -47

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/params.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#include <xen-tools/libs.h>
/* Needed for Python versions earlier than 2.3. */
#ifndef PyMODINIT_FUNC
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.