diff --git a/lib/libc/minimal/CMakeLists.txt b/lib/libc/minimal/CMakeLists.txt index 036a4f139c0..2eeffadeac1 100644 --- a/lib/libc/minimal/CMakeLists.txt +++ b/lib/libc/minimal/CMakeLists.txt @@ -14,7 +14,6 @@ zephyr_library_sources( source/string/strstr.c source/string/string.c source/string/strspn.c - source/stdout/prf.c source/stdout/stdout_console.c source/stdout/sprintf.c source/stdout/fprintf.c diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt index 8b3cd1bbdfc..c19cc83cf2b 100644 --- a/lib/os/CMakeLists.txt +++ b/lib/os/CMakeLists.txt @@ -23,6 +23,9 @@ zephyr_sources( heap-validate.c ) +zephyr_sources_ifdef(CONFIG_MINIMAL_LIBC prf.c) +zephyr_sources_ifdef(CONFIG_SHELL prf.c) + zephyr_sources_ifdef(CONFIG_JSON_LIBRARY json.c) zephyr_sources_ifdef(CONFIG_RING_BUFFER ring_buffer.c) diff --git a/lib/libc/minimal/source/stdout/prf.c b/lib/os/prf.c similarity index 100% rename from lib/libc/minimal/source/stdout/prf.c rename to lib/os/prf.c diff --git a/subsys/shell/shell_fprintf.c b/subsys/shell/shell_fprintf.c index 1f6e8b0b165..5f59ea57e8e 100644 --- a/subsys/shell/shell_fprintf.c +++ b/subsys/shell/shell_fprintf.c @@ -7,12 +7,7 @@ #include #include -#ifdef CONFIG_NEWLIB_LIBC -typedef int (*out_func_t)(int c, void *ctx); -extern void z_vprintk(out_func_t out, void *ctx, const char *fmt, va_list ap); -#else extern int z_prf(int (*func)(), void *dest, char *format, va_list vargs); -#endif static int out_func(int c, void *ctx) { @@ -39,11 +34,7 @@ static int out_func(int c, void *ctx) void shell_fprintf_fmt(const struct shell_fprintf *sh_fprintf, const char *fmt, va_list args) { -#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_ARCH_POSIX) (void)z_prf(out_func, (void *)sh_fprintf, (char *)fmt, args); -#else - z_vprintk(out_func, (void *)sh_fprintf, fmt, args); -#endif if (sh_fprintf->ctrl_blk->autoflush) { shell_fprintf_buffer_flush(sh_fprintf);