Prechádzať zdrojové kódy

[module] fix missing dfs_posix.h.

shandianchengzi 1 rok pred
rodič
commit
761b63b822

+ 5 - 0
module/wn_module_asp.c

@@ -25,7 +25,12 @@
 #include <rtthread.h>
 
 #ifdef RT_USING_DFS
+#if RT_VER_NUM >= 0x40100
+#include <stdio.h> /* fix SEEK_END */
+#include <fcntl.h> /* fix O_RDONLY */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 #endif
 
 #ifdef RT_USING_SAL

+ 4 - 0
module/wn_module_cgi.c

@@ -28,7 +28,11 @@
 #include <wn_utils.h>
 
 #ifdef RT_USING_DFS
+#if RT_VER_NUM >= 0x40100
+#include <strings.h> /* fix strncasecmp */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 #endif
 
 #ifdef WEBNET_USING_CGI

+ 5 - 1
module/wn_module_index.c

@@ -27,9 +27,13 @@
 #include <wn_utils.h>
 
 #ifdef RT_USING_DFS
+#if RT_VER_NUM >= 0x40100
+#include <dirent.h> /* fix DIR */
+#include <fcntl.h> /* fix S_IFDIR */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 #endif
-
 #ifdef WEBNET_USING_INDEX
 
 int webnet_module_dirindex(struct webnet_session* session, int event)

+ 6 - 0
module/wn_module_ssi.c

@@ -27,7 +27,13 @@
 #include <wn_module.h>
 
 #ifdef RT_USING_DFS
+#if RT_VER_NUM >= 0x40100
+#include <stdio.h> /* fix SEEK_END */
+#include <fcntl.h> /* fix O_RDONLY */
+#include <unistd.h> /* fix lseek */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 #endif
 
 #if defined(WEBNET_USING_SSI)

+ 4 - 0
module/wn_module_upload.c

@@ -26,7 +26,11 @@
 #include <wn_utils.h>
 
 #ifdef RT_USING_DFS
+#if RT_VER_NUM >= 0x40100
+#include <fcntl.h> /* fix O_WRONLY */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 #endif
 
 #if defined(WEBNET_USING_UPLOAD)

+ 4 - 0
samples/wn_sample_upload.c

@@ -25,7 +25,11 @@
 #include <string.h>
 
 #include <rtthread.h>
+#if RT_VER_NUM >= 0x40100
+#include <fcntl.h> /* 当需要使用文件操作时,需要包含这个头文件 */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 
 #include <webnet.h>
 #include <wn_module.h>

+ 6 - 0
src/wn_module.c

@@ -31,7 +31,13 @@
 #include <wn_utils.h>
 
 #ifdef RT_USING_DFS
+#if RT_VER_NUM >= 0x40100
+#include <fcntl.h> /* fix O_RDONLY */
+#include <unistd.h> /* fix lseek */
+#include <stdlib.h> /* fix atoi */
+#else
 #include <dfs_posix.h>
+#endif /*RT_VER_NUM >= 0x40100*/
 #endif
 
 static int _webnet_module_system_init(struct webnet_session *session, int event)