summaryrefslogtreecommitdiff
path: root/components/libc/compilers/dlib/syscall_write.c
diff options
context:
space:
mode:
authorOuxiaolong <[email protected]>2022-01-09 12:39:51 +0800
committerOuxiaolong <[email protected]>2022-01-09 12:39:51 +0800
commitecba17963ca12e568511edfc056c34720de000b3 (patch)
tree82f44220b5498df4270bd1652360863d583fb69a /components/libc/compilers/dlib/syscall_write.c
parentdafa934443fa34137217bf9dd59f486946fa4c1e (diff)
parent10a963b955f1f5c7333c4f1668dd20ff27283e85 (diff)
Merge branch 'master' of github.com:Ouxiaolong/rt-thread
Diffstat (limited to 'components/libc/compilers/dlib/syscall_write.c')
-rw-r--r--components/libc/compilers/dlib/syscall_write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/libc/compilers/dlib/syscall_write.c b/components/libc/compilers/dlib/syscall_write.c
index 3af08daba9..4eead9aa38 100644
--- a/components/libc/compilers/dlib/syscall_write.c
+++ b/components/libc/compilers/dlib/syscall_write.c
@@ -40,7 +40,7 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
if ((handle == _LLIO_STDOUT) || (handle == _LLIO_STDERR))
{
-#ifdef RT_USING_CONSOLE
+#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
rt_device_t console_device;
console_device = rt_console_get_device();
@@ -52,7 +52,7 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
return len; /* return the length of the data written */
#else
return _LLIO_ERROR;
-#endif /* RT_USING_CONSOLE */
+#endif /* defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) */
}
else if (handle == _LLIO_STDIN)
{