summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprife <[email protected]>2013-02-26 16:36:33 +0800
committerprife <[email protected]>2013-02-26 16:36:33 +0800
commit8928f4e4b7070d28b885c4af0c6c3a588771d057 (patch)
treec27795a1925eca2402fc763630b060a329814045
parent9f355875d866f4b95798955efc6b3eff76ecc337 (diff)
mingw support for simulator: dfs/dfs_win32
-rw-r--r--bsp/simulator/applications/dfs_win32.c16
-rwxr-xr-xbsp/simulator/rtconfig.h2
2 files changed, 17 insertions, 1 deletions
diff --git a/bsp/simulator/applications/dfs_win32.c b/bsp/simulator/applications/dfs_win32.c
index 121ed39b81..acc8a3cb0a 100644
--- a/bsp/simulator/applications/dfs_win32.c
+++ b/bsp/simulator/applications/dfs_win32.c
@@ -27,6 +27,22 @@
#include <WinError.h>
#include <windows.h>
+#if defined(__MINGW32__) && defined(_NO_OLDNAMES)
+#define O_RDONLY _O_RDONLY
+#define O_WRONLY _O_WRONLY
+#define O_RDWR _O_RDWR
+#define O_ACCMODE _O_ACCMODE
+#define O_APPEND _O_APPEND
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#define O_EXCL _O_EXCL
+#define O_TEXT _O_TEXT
+#define O_BINARY _O_BINARY
+#define O_TEMPORARY _O_TEMPORARY
+#define O_NOINHERIT _O_NOINHERIT
+#define O_SEQUENTIAL _O_SEQUENTIAL
+#define O_RANDOM _O_RANDOM
+#endif
/*
* RT-Thread DFS Interface for win-directory as an disk device
*/
diff --git a/bsp/simulator/rtconfig.h b/bsp/simulator/rtconfig.h
index 81e8c0d9d7..79c90eb1e9 100755
--- a/bsp/simulator/rtconfig.h
+++ b/bsp/simulator/rtconfig.h
@@ -143,7 +143,7 @@
/* DFS: windows share directory mounted to rt-thread/dfs */
/* only used in bsp/simulator */
#ifdef _WIN32
-//#define RT_USING_DFS_WINSHAREDIR
+#define RT_USING_DFS_WINSHAREDIR
#endif
/* the max number of mounted file system */