From 3a33906ab1fe7b3438d9614945ede7f343280459 Mon Sep 17 00:00:00 2001 From: prife Date: Thu, 17 Oct 2013 21:13:08 +0800 Subject: [PATCH] simulator/jffs2: remove _TIME_T_DEFINED when built by VC++ _TIME_T_DEFINED was pre-defined in order to build jffs2 with VC. While it may cause many side effects. --- bsp/simulator/SConstruct | 1 - components/dfs/filesystems/jffs2/include/port/sys/stat.h | 3 ++- components/dfs/filesystems/jffs2/include/port/sys/types.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bsp/simulator/SConstruct b/bsp/simulator/SConstruct index a95fe7d23f..3f8508d5cb 100755 --- a/bsp/simulator/SConstruct +++ b/bsp/simulator/SConstruct @@ -45,7 +45,6 @@ if rtconfig.PLATFORM == 'cl': _DEBUG _CONSOLE MSVC - _TIME_T_DEFINED ''') env.Append(CCFLAGS=rtconfig.CFLAGS) env.Append(LINKFLAGS=rtconfig.LFLAGS) diff --git a/components/dfs/filesystems/jffs2/include/port/sys/stat.h b/components/dfs/filesystems/jffs2/include/port/sys/stat.h index 783c1d8d6c..845f40d1f4 100644 --- a/components/dfs/filesystems/jffs2/include/port/sys/stat.h +++ b/components/dfs/filesystems/jffs2/include/port/sys/stat.h @@ -317,10 +317,11 @@ typedef void *cyg_io_handle_t; #define S_ISGID (1<<26) #if defined(MSVC) +/* for time_t */ +#include typedef unsigned long mode_t; typedef unsigned int ino_t; typedef unsigned int dev_t; -typedef int time_t; typedef long ssize_t; #elif defined(__CC_ARM) #define mode_t unsigned long diff --git a/components/dfs/filesystems/jffs2/include/port/sys/types.h b/components/dfs/filesystems/jffs2/include/port/sys/types.h index b193a58ab9..ab195a57ea 100644 --- a/components/dfs/filesystems/jffs2/include/port/sys/types.h +++ b/components/dfs/filesystems/jffs2/include/port/sys/types.h @@ -78,7 +78,11 @@ typedef unsigned short gid_t; typedef unsigned short uid_t; typedef int pid_t; +#if defined(MSVC) +#include +#else typedef int time_t; +#endif //#include "os_sys_stat.h" #endif /* CYGONCE_ISO_SYS_TYPES_H multiple inclusion protection */