Modify the link mode, compile each component to static library first and then link them

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1405 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
qiuyiuestc@gmail.com
2011-05-16 00:29:28 +00:00
parent 7a6949f248
commit c99ca774a1
8 changed files with 60 additions and 27 deletions
+21
View File
@@ -291,6 +291,7 @@ void zcfree (voidpf opaque, voidpf ptr)
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
#ifdef RT_USING_RTGUI
extern voidp rtgui_malloc OF((uInt size));
extern voidp rtgui_calloc OF((uInt items, uInt size));
extern void rtgui_free OF((voidpf ptr));
@@ -312,5 +313,25 @@ void zcfree (opaque, ptr)
rtgui_free(ptr);
if (opaque) return; /* make compiler happy */
}
#else
voidpf zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
{
if (opaque) items += size - size; /* make compiler happy */
return sizeof(uInt) > 2 ? (voidpf)rt_malloc(items * size) :
(voidpf)rt_calloc(items, size);
}
void zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{
rt_free(ptr);
if (opaque) return; /* make compiler happy */
}
#endif
#endif /* MY_ZCALLOC */