Skip to content

Commit 070f240

Browse files
committed
[klibc] add RT_USING_LIBC for kstdio
1 parent d9c16ef commit 070f240

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/klibc/kstdio.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
extern "C" {
1616
#endif
1717

18+
#ifdef RT_USING_LIBC
19+
1820
int rt_vsprintf(char *dest, const char *format, va_list arg_ptr);
1921
int rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list args);
2022
int rt_sprintf(char *buf, const char *format, ...);
2123
int rt_snprintf(char *buf, rt_size_t size, const char *format, ...);
2224

25+
#endif /* RT_USING_LIBC */
26+
2327
#ifdef __cplusplus
2428
}
2529
#endif

src/klibc/kstdio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#include <rtthread.h>
1212

13+
#ifdef RT_USING_LIBC
14+
1315
#define DBG_TAG "kernel.stdio"
1416
#ifdef RT_DEBUG_DEVICE
1517
#define DBG_LVL DBG_LOG
@@ -681,3 +683,5 @@ int rt_sprintf(char *buf, const char *format, ...)
681683
return n;
682684
}
683685
RTM_EXPORT(rt_sprintf);
686+
687+
#endif /* RT_USING_LIBC */

0 commit comments

Comments
 (0)