diff options
| author | [email protected] <[email protected]> | 2011-05-16 00:29:28 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-05-16 00:29:28 +0000 |
| commit | c99ca774a1fc441cf4f24a48a565ccd564d55cf0 (patch) | |
| tree | b1449d661531e472297745ac1fbacdd7085f9d2a /components/external/libz | |
| parent | 7a6949f248d3f1139825451a672bc41d9efc6d52 (diff) | |
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
Diffstat (limited to 'components/external/libz')
| -rw-r--r-- | components/external/libz/zutil.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/components/external/libz/zutil.c b/components/external/libz/zutil.c index 19d2760e6c..16e9ac962e 100644 --- a/components/external/libz/zutil.c +++ b/components/external/libz/zutil.c @@ -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 */ |
