diff --git a/components/libc/compilers/armlibc/libc.h b/components/libc/compilers/armlibc/libc.h index 5e9f68218d..aef0324018 100644 --- a/components/libc/compilers/armlibc/libc.h +++ b/components/libc/compilers/armlibc/libc.h @@ -32,6 +32,6 @@ int libc_system_init(void); int libc_stdio_set_console(const char* device_name, int mode); int libc_stdio_read (void *buffer, size_t size); -int libc_stdio_write(void *buffer, size_t size); +int libc_stdio_write(const void *buffer, size_t size); #endif diff --git a/components/libc/compilers/armlibc/stdio.c b/components/libc/compilers/armlibc/stdio.c index 8c9c99b3ad..cba51beb18 100644 --- a/components/libc/compilers/armlibc/stdio.c +++ b/components/libc/compilers/armlibc/stdio.c @@ -63,7 +63,7 @@ int libc_stdio_read(void *buffer, size_t size) return read(std_fd, buffer, size); } -int libc_stdio_write(void *buffer, size_t size) +int libc_stdio_write(const void *buffer, size_t size) { return write(std_fd, buffer, size); } diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index 0de8aacb3c..719665b78e 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -31,6 +31,7 @@ #include #include "rtthread.h" +#include "libc.h" #ifdef RT_USING_DFS #include "dfs_posix.h"