From b822ac8ff62f3f065c7db64454c9359c00c59255 Mon Sep 17 00:00:00 2001 From: liang yongxiang Date: Tue, 17 Jul 2018 11:01:14 +0800 Subject: [PATCH] [libc] fix compilation error when RT_USING_HEAP is disable --- components/libc/compilers/armlibc/mem_std.c | 2 ++ components/libc/compilers/dlib/syscall_mem.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/libc/compilers/armlibc/mem_std.c b/components/libc/compilers/armlibc/mem_std.c index 5da5bb6c6c..7fa0033f9d 100644 --- a/components/libc/compilers/armlibc/mem_std.c +++ b/components/libc/compilers/armlibc/mem_std.c @@ -15,6 +15,7 @@ #include "rtthread.h" +#ifdef RT_USING_HEAP /* avoid the heap and heap-using library functions supplied by arm */ #pragma import(__use_no_heap) @@ -41,3 +42,4 @@ void free(void *rmem) rt_free(rmem); } RTM_EXPORT(free); +#endif diff --git a/components/libc/compilers/dlib/syscall_mem.c b/components/libc/compilers/dlib/syscall_mem.c index 05e79f50b2..b3933ba910 100644 --- a/components/libc/compilers/dlib/syscall_mem.c +++ b/components/libc/compilers/dlib/syscall_mem.c @@ -23,6 +23,7 @@ */ #include +#ifdef RT_USING_HEAP void *malloc(rt_size_t n) { return rt_malloc(n); @@ -42,3 +43,4 @@ void free(void *rmem) { rt_free(rmem); } +#endif