diff --git a/porting/liteos_m/kernel/BUILD.gn b/porting/liteos_m/kernel/BUILD.gn index f638d4862f58ac4e92656b7fd9beba9357a54304..1008f2e8b08ceebb5060843b312c8fb2279179bb 100644 --- a/porting/liteos_m/kernel/BUILD.gn +++ b/porting/liteos_m/kernel/BUILD.gn @@ -63,6 +63,7 @@ static_library(libc) { "src/ctype/tolower.c", "src/ctype/toupper.c", "src/ctype/isprint.c", + "src/ctype/__ctype_get_mb_cur_max.c", "src/misc/dirname.c", "src/locale/__lctrans.c", "src/locale/langinfo.c", @@ -96,6 +97,7 @@ static_library(libc) { "src/stdio/feof.c", "src/stdio/fopen.c", "src/stdio/stdout.c", + "src/stdio/stdin.c", "src/time/strptime.c", "src/time/strftime.c", "src/time/__year_to_secs.c", diff --git a/porting/liteos_m/kernel/src/ctype/__ctype_get_mb_cur_max.c b/porting/liteos_m/kernel/src/ctype/__ctype_get_mb_cur_max.c new file mode 100644 index 0000000000000000000000000000000000000000..8e946fc12bcfcf17ebe672e13ab05b163b242f5b --- /dev/null +++ b/porting/liteos_m/kernel/src/ctype/__ctype_get_mb_cur_max.c @@ -0,0 +1,7 @@ +#include +#include "locale_impl.h" + +size_t __ctype_get_mb_cur_max() +{ + return MB_CUR_MAX; +} diff --git a/porting/liteos_m/kernel/src/stdio/stdin.c b/porting/liteos_m/kernel/src/stdio/stdin.c new file mode 100644 index 0000000000000000000000000000000000000000..5aa5262c2a5c8822f9006431898887789421c6e1 --- /dev/null +++ b/porting/liteos_m/kernel/src/stdio/stdin.c @@ -0,0 +1,17 @@ +#include "stdio_impl.h" + +#undef stdin + +static unsigned char buf[BUFSIZ+UNGET]; +hidden FILE __stdin_FILE = { + .buf = buf+UNGET, + .buf_size = sizeof buf-UNGET, + .fd = 0, + .flags = F_PERM | F_NOWR, + .read = __stdio_read, + .seek = __stdio_seek, + .close = __stdio_close, + .lock = -1, +}; +FILE *const stdin = &__stdin_FILE; +FILE *volatile __stdin_used = &__stdin_FILE;