qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifnd


From: Emilio G. Cota
Subject: [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef
Date: Thu, 30 Apr 2015 15:16:30 -0400

ARRAY_SIZE is defined in osdep.h so having an unconditional
definition here is fragile.

Signed-off-by: Emilio G. Cota <address@hidden>
---
 tests/i440fx-test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index d0bc8de..d610e66 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -27,7 +27,9 @@
 
 #define BROKEN 1
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+#endif
 
 typedef struct TestData
 {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]