From c99ca774a1fc441cf4f24a48a565ccd564d55cf0 Mon Sep 17 00:00:00 2001 From: "qiuyiuestc@gmail.com" Date: Mon, 16 May 2011 00:29:28 +0000 Subject: 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 --- components/external/libpng/pngconf.h | 6 +++--- components/external/libz/zutil.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'components/external') diff --git a/components/external/libpng/pngconf.h b/components/external/libpng/pngconf.h index 0cc2fc3551..047376302d 100644 --- a/components/external/libpng/pngconf.h +++ b/components/external/libpng/pngconf.h @@ -22,13 +22,13 @@ #ifdef __RT_THREAD__ #include #define PNG_MAX_MALLOC_64K +#define PNG_NO_STDIO #ifndef RT_USING_NEWLIB #define PNG_NO_WRITE_SUPPORTED -#define PNG_NO_STDIO #define PNG_NO_SETJMP_SUPPORTED -#define malloc rtgui_malloc -#define free rtgui_free +#define malloc rtgui_malloc +#define free rtgui_free #endif #endif 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 */ -- cgit v1.3.1