summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-09-13 11:34:10 -0400
committerMeco Man <[email protected]>2021-09-13 11:39:04 -0400
commite91ffdd1a0af24831d0f7d99c88b6332975ed880 (patch)
treec7f892fe8f2da4ea1eec291ecf3506cd063c7b45
parent160d448660f183cbc9d1a9936d3dada536ac172b (diff)
[libc] fix the conflict warning of read and write functions
-rw-r--r--bsp/x86/drivers/floppy.c2
-rw-r--r--components/dfs/src/dfs_posix.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/bsp/x86/drivers/floppy.c b/bsp/x86/drivers/floppy.c
index c144eb02eb..be3ab4c179 100644
--- a/bsp/x86/drivers/floppy.c
+++ b/bsp/x86/drivers/floppy.c
@@ -357,7 +357,7 @@ void rt_floppy_init(void)
device->read = rt_floppy_read;
device->write = rt_floppy_write;
device->control = rt_floppy_control;
- device->user_data = NULL;
+ device->user_data = RT_NULL;
rt_device_register(device, "floppy",
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_REMOVABLE | RT_DEVICE_FLAG_STANDALONE);
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c
index be3b039818..ed3fdb2eeb 100644
--- a/components/dfs/src/dfs_posix.c
+++ b/components/dfs/src/dfs_posix.c
@@ -110,7 +110,11 @@ RTM_EXPORT(close);
* @return the actual read data buffer length. If the returned value is 0, it
* may be reach the end of file, please check errno.
*/
+#ifdef _READ_WRITE_RETURN_TYPE
+_READ_WRITE_RETURN_TYPE read(int fd, void *buf, size_t len) /* some gcc tool chains will use different data structure */
+#else
ssize_t read(int fd, void *buf, size_t len)
+#endif
{
int result;
struct dfs_fd *d;
@@ -150,7 +154,11 @@ RTM_EXPORT(read);
*
* @return the actual written data buffer length.
*/
+#ifdef _READ_WRITE_RETURN_TYPE
+_READ_WRITE_RETURN_TYPE write(int fd, const void *buf, size_t len) /* some gcc tool chains will use different data structure */
+#else
ssize_t write(int fd, const void *buf, size_t len)
+#endif
{
int result;
struct dfs_fd *d;