提交 aa0c9e34 编写于 作者: G Giuseppe CONDORELLI 提交者: Tom Rix

zlib: fix code when DEBUG is defined

Removed stdio.h inclusion and moved trace macros to use printf avoiding to
write debug informations to standard error.
Signed-off-by: NGiuseppe Condorelli <giuseppe.condorelli@st.com>
上级 897e6d06
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define ZLIB_INTERNAL #define ZLIB_INTERNAL
#include "u-boot/zlib.h" #include "u-boot/zlib.h"
#include <common.h>
/* To avoid a build time warning */ /* To avoid a build time warning */
#ifdef STDC #ifdef STDC
#include <malloc.h> #include <malloc.h>
...@@ -83,10 +84,10 @@ typedef unsigned long ulg; ...@@ -83,10 +84,10 @@ typedef unsigned long ulg;
/* Diagnostic functions */ /* Diagnostic functions */
#ifdef DEBUG #ifdef DEBUG
#include <stdio.h>
extern int z_verbose; extern int z_verbose;
extern void z_error OF((char *m)); extern void z_error OF((char *m));
#define Assert(cond,msg) {if(!(cond)) z_error(msg);} #define Assert(cond,msg) {if(!(cond)) z_error(msg);}
#define fprintf(fp,...) printf(__VA_ARGS__)
#define Trace(x) {if (z_verbose>=0) fprintf x ;} #define Trace(x) {if (z_verbose>=0) fprintf x ;}
#define Tracev(x) {if (z_verbose>0) fprintf x ;} #define Tracev(x) {if (z_verbose>0) fprintf x ;}
#define Tracevv(x) {if (z_verbose>1) fprintf x ;} #define Tracevv(x) {if (z_verbose>1) fprintf x ;}
...@@ -2000,7 +2001,7 @@ void z_error (m) ...@@ -2000,7 +2001,7 @@ void z_error (m)
char *m; char *m;
{ {
fprintf(stderr, "%s\n", m); fprintf(stderr, "%s\n", m);
exit(1); hang ();
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册