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

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

Comments

York Sun - April 4, 2013, 9:52 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>
---
change since v1: fix typo in comment

 common/cmd_test.c |    9 +++++++++
 1 file changed, 9 insertions(+)
Tom Rini - April 8, 2013, 4:27 p.m.
On Thu, Apr 04, 2013 at 11:52:53AM -0000, York Sun wrote:

> 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>

Applied to u-boot/master, thanks!

Patch

diff --git a/common/cmd_test.c b/common/cmd_test.c
index d4ec186..acc0ecf 100644
--- a/common/cmd_test.c
+++ b/common/cmd_test.c
@@ -21,6 +21,15 @@ 
  * MA 02111-1307 USA
  */
 
+/*
+ * Define _STDBOOL_H here to avoid macro expansion of true and false.
+ * If the future code requires macro true or false, remove this define
+ * and undef true and false before U_BOOT_CMD. This define and comment
+ * shall be removed if change to U_BOOT_CMD is made to take string
+ * instead of stringifying it.
+ */
+#define _STDBOOL_H
+
 #include <common.h>
 #include <command.h>