From 0acf4418362f692b8a72fe5aa8fbf6f51e202d63 Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 6 Jun 2017 23:34:01 +0800 Subject: [PATCH] Fix compiling warning for Win32. --- components/dfs/include/dfs_posix.h | 4 +++- include/rtthread.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h index f3da7b553..3e6f5f180 100644 --- a/components/dfs/include/dfs_posix.h +++ b/components/dfs/include/dfs_posix.h @@ -34,7 +34,7 @@ extern "C" { #endif -#ifndef RT_USING_NEWLIB +#if !defined(RT_USING_NEWLIB) #define O_RDONLY DFS_O_RDONLY #define O_WRONLY DFS_O_WRONLY #define O_RDWR DFS_O_RDWR @@ -46,6 +46,7 @@ extern "C" { #define O_BINARY DFS_O_BINARY #define O_DIRECTORY DFS_O_DIRECTORY +#if !defined(_WIN32) #define S_IFMT DFS_S_IFMT #define S_IFSOCK DFS_S_IFSOCK #define S_IFLNK DFS_S_IFLNK @@ -80,6 +81,7 @@ extern "C" { #define S_IROTH DFS_S_IROTH #define S_IWOTH DFS_S_IWOTH #define S_IXOTH DFS_S_IXOTH +#endif #if defined(__CC_ARM) #include diff --git a/include/rtthread.h b/include/rtthread.h index 2037645e4..f67bab997 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -507,7 +507,7 @@ rt_device_t rt_console_get_device(void); rt_err_t rt_get_errno(void); void rt_set_errno(rt_err_t no); int *_rt_errno(void); -#ifndef RT_USING_NEWLIB +#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) #ifndef errno #define errno *_rt_errno() #endif