mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-30 19:18:19 +08:00
[DFS] fix the compiling issue under Keil MDK.
This commit is contained in:
@@ -29,6 +29,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <lwip/sockets.h>
|
||||||
|
|
||||||
struct dfs_filesystem* dfs_lwip_get_fs(void);
|
struct dfs_filesystem* dfs_lwip_get_fs(void);
|
||||||
int dfs_lwip_getsocket(int fd);
|
int dfs_lwip_getsocket(int fd);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
|
|
||||||
#include <dfs.h>
|
#include <dfs.h>
|
||||||
#include <dfs_def.h>
|
#include <dfs_def.h>
|
||||||
#include <lwip/sockets.h>
|
#include <dfs_posix.h>
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "dfs_lwip.h"
|
#include "dfs_lwip.h"
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* File : select.h
|
||||||
|
* This file is part of RT-Thread RTOS
|
||||||
|
* COPYRIGHT (C) 2015, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2015-05-02 Bernard First version
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SELECT_H__
|
||||||
|
#define SELECT_H__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* select API */
|
||||||
|
#ifdef RT_USING_LWIP
|
||||||
|
/* we use lwIP's structure definitions. */
|
||||||
|
#include <lwip/sockets.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
||||||
|
struct timeval *timeout);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* File : netdb.h
|
* File : socket.h
|
||||||
* This file is part of RT-Thread RTOS
|
* This file is part of RT-Thread RTOS
|
||||||
* COPYRIGHT (C) 2015, RT-Thread Development Team
|
* COPYRIGHT (C) 2015, RT-Thread Development Team
|
||||||
*
|
*
|
||||||
@@ -29,6 +29,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <lwip/sockets.h>
|
||||||
|
|
||||||
int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
||||||
int bind(int s, const struct sockaddr *name, socklen_t namelen);
|
int bind(int s, const struct sockaddr *name, socklen_t namelen);
|
||||||
int shutdown(int s, int how);
|
int shutdown(int s, int how);
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
#include <dfs_file.h>
|
#include <dfs_file.h>
|
||||||
#include <dfs_def.h>
|
#include <dfs_def.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef RT_USING_NEWLIB
|
#ifndef RT_USING_NEWLIB
|
||||||
#define O_RDONLY DFS_O_RDONLY
|
#define O_RDONLY DFS_O_RDONLY
|
||||||
#define O_WRONLY DFS_O_WRONLY
|
#define O_WRONLY DFS_O_WRONLY
|
||||||
@@ -79,6 +83,7 @@
|
|||||||
|
|
||||||
#if defined(__CC_ARM)
|
#if defined(__CC_ARM)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#else
|
#else
|
||||||
@@ -109,6 +114,8 @@ int closedir(DIR* d);
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct stat;
|
||||||
|
|
||||||
/* file api*/
|
/* file api*/
|
||||||
int open(const char *file, int flags, int mode);
|
int open(const char *file, int flags, int mode);
|
||||||
int close(int d);
|
int close(int d);
|
||||||
@@ -126,5 +133,8 @@ int rmdir(const char *path);
|
|||||||
int chdir(const char *path);
|
int chdir(const char *path);
|
||||||
char *getcwd(char *buf, size_t size);
|
char *getcwd(char *buf, size_t size);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -353,8 +353,25 @@
|
|||||||
#define LWIP_RAND rand
|
#define LWIP_RAND rand
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RT_USING_DFS_LWIP
|
#if defined(RT_USING_DFS_LWIP)
|
||||||
#define LWIP_COMPAT_SOCKETS 0
|
#define LWIP_COMPAT_SOCKETS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
|
||||||
|
|
||||||
|
#if defined(RT_USING_PTHREADS)
|
||||||
|
#define LWIP_TIMEVAL_PRIVATE 0
|
||||||
|
#include <posix_types.h>
|
||||||
|
#else
|
||||||
|
/* there is no timeval in CC_ARM and IAR */
|
||||||
|
#define LWIP_TIMEVAL_PRIVATE 1
|
||||||
|
#endif /* RT_USING_PTHREADS */
|
||||||
|
|
||||||
|
#elif defined (__GNUC__)
|
||||||
|
|
||||||
|
#define LWIP_TIMEVAL_PRIVATE 0
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __LWIPOPTS_H__ */
|
#endif /* __LWIPOPTS_H__ */
|
||||||
|
|||||||
Reference in New Issue
Block a user