Patchwork [U-Boot,alt] common/cmd_test: Avoid macro expansion

login
register
mail settings
Submitter York Sun
Date April 4, 2013, 9:57 p.m.
Message ID <1365112624-28654-1-git-send-email-yorksun@freescale.com>
Download mbox | patch
Permalink /patch/233957/
State Deferred
Delegated to: Tom Rini
Headers show

Comments

York Sun - April 4, 2013, 9:57 p.m.
cmd_test.c adds "true" and "false" as new commands. We need to avoid macro
expansion for U_BOOT_CMD.

Signed-off-by: York Sun <yorksun@freescale.com>
---
This is alternative patch to fix macro expansion issue for cmd_test.c

 common/cmd_test.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/common/cmd_test.c b/common/cmd_test.c
index d4ec186..26a84af 100644
--- a/common/cmd_test.c
+++ b/common/cmd_test.c
@@ -144,6 +144,14 @@  static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return expr;
 }
 
+#ifdef true
+#undef true
+#endif
+
+#ifdef false
+#undef false
+#endif
+
 U_BOOT_CMD(
 	test,	CONFIG_SYS_MAXARGS,	1,	do_test,
 	"minimal test like /bin/sh",