From dabe951415385948450335979d1e59a0dc27ae1f Mon Sep 17 00:00:00 2001
From: zhangjun <2281979437@qq.com>
Date: Mon, 2 Sep 2019 14:52:32 +0800
Subject: [PATCH] =?UTF-8?q?[components][libc][common]=E4=BF=AE=E6=94=B9=5F?=
 =?UTF-8?q?=5FIAR=5FSYSTEMS=5FICC=5F=5F=E5=AE=8F=E5=AE=9A=E4=B9=89?=
 =?UTF-8?q?=E7=9A=84=E4=BD=9C=E7=94=A8=E8=8C=83=E5=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/libc/compilers/common/time.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c
index ed7a232079..097faedfe5 100644
--- a/components/libc/compilers/common/time.c
+++ b/components/libc/compilers/common/time.c
@@ -34,15 +34,6 @@ static long int timezone;
 static const char days[] = "Sun Mon Tue Wed Thu Fri Sat ";
 static const char months[] = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ";
 
-/*
- * Structure returned by gettimeofday(2) system call,
- * and used in other calls.
- */
-struct timeval {
-	long	tv_sec;		/* seconds */
-	long	tv_usec;	/* and microseconds */
-};
-
 /* seconds per day */
 #define SPD 24*60*60
 
@@ -220,6 +211,17 @@ char* ctime(const time_t *timep)
     return asctime(localtime(timep));
 }
 
+#endif /* __IAR_SYSTEMS_ICC__ */
+
+/*
+ * Structure returned by gettimeofday(2) system call,
+ * and used in other calls.
+ */
+struct timeval {
+    long    tv_sec;     /* seconds */
+    long    tv_usec;    /* and microseconds */
+};
+
 #ifdef RT_USING_DEVICE
 int gettimeofday(struct timeval *tp, void *ignore)
 {
@@ -250,7 +252,6 @@ int _gettimeofday( struct timeval *tv, void *ignore)
 }
 #endif
 
-#endif /* __IAR_SYSTEMS_ICC__ */
 
 /**
  * Returns the current time.