diff options
| author | Bernard Xiong <[email protected]> | 2019-09-03 08:00:10 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-03 08:00:10 +0800 |
| commit | 515779c5d1502b1b09ad21b73eb09b13fd3756c2 (patch) | |
| tree | 86fb9ef52b398554e533a3bc84e64a9b13a593ca /components | |
| parent | 13e319f44972962f29df9b329370571202d3c791 (diff) | |
| parent | dabe951415385948450335979d1e59a0dc27ae1f (diff) | |
Merge pull request #3025 from zhangjun1996/master
[components][libc][common]修改__IAR_SYSTEMS_ICC__宏定义的作用范围
Diffstat (limited to 'components')
| -rw-r--r-- | components/libc/compilers/common/time.c | 21 |
1 files 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. |
