]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/XenBusDxe: guard the definition of ARRAY_SIZE
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 Oct 2016 12:14:47 +0000 (14:14 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 27 Oct 2016 08:50:04 +0000 (10:50 +0200)
In one of the next patches, we'll introduce ARRAY_SIZE in
"MdePkg/Include/Base.h". In order to proceed in small steps, make the
module-local definition of ARRAY_SIZE conditional. This way the
introduction of the macro under MdePkg will silently switch this module
over (after which we can remove the module-local definition completely).

Cc: Gary Lin <glin@suse.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gary Lin <glin@suse.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/XenBusDxe/XenStore.c

index b7ae1d04863d8941e5b56b79796a77cd30317ded..9eeb6f54fb50293dd2063903c9e9b606193db0b4 100644 (file)
@@ -713,7 +713,9 @@ static XenStoreErrors gXenStoreErrors[] = {
   { XENSTORE_STATUS_EISCONN, "EISCONN" },\r
   { XENSTORE_STATUS_E2BIG, "E2BIG" }\r
 };\r
+#ifndef ARRAY_SIZE\r
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))\r
+#endif\r
 \r
 STATIC\r
 XENSTORE_STATUS\r