From 60e88011e8f0411c54e94f857ac6a53ce4d20d65 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Sun, 27 Sep 2009 23:58:05 +0000 Subject: [PATCH] cleanup code for IAR and ARMCC compiler git-svn-id: https://rt-thread.googlecode.com/svn/trunk@51 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- finsh/finsh.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/finsh/finsh.h b/finsh/finsh.h index a913588d4..1eb031023 100644 --- a/finsh/finsh.h +++ b/finsh/finsh.h @@ -50,16 +50,21 @@ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned long u_long; -typedef unsigned int size_t; + +#if !defined(__CC_ARM) && !defined(__ICCARM__) +typedef unsigned int size_t; #ifndef NULL #define NULL RT_NULL -#endif +#endif #define memset rt_memset #define strlen rt_strlen #define strncpy rt_strncpy #define strncmp rt_strncmp +#else +#include +#endif int strcmp (const char *s1, const char *s2); char *strdup(const char *s); @@ -260,10 +265,10 @@ int finsh_init(struct finsh_parser* parser); int finsh_flush(struct finsh_parser* parser); /* reset all of finsh */ int finsh_reset(struct finsh_parser* parser); -#ifdef RT_USING_DEVICE -/* set finsh device */ -void finsh_set_device(char* device_name); -#endif +#ifdef RT_USING_DEVICE +/* set finsh device */ +void finsh_set_device(char* device_name); +#endif /* run finsh parser to generate abstract synatx tree */ void finsh_parser_run (struct finsh_parser* parser, const unsigned char* string);