]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib_generic/zlib.c
zlib: fix code when DEBUG is defined
[karo-tx-uboot.git] / lib_generic / zlib.c
index 1b6db3214e9c98cce1903198fba907808b8e42c1..8fe3bd0dd12363d8b4ce79c93ce111fe40b4ccb0 100644 (file)
@@ -27,6 +27,7 @@
 #define ZLIB_INTERNAL
 
 #include "u-boot/zlib.h"
+#include <common.h>
 /* To avoid a build time warning */
 #ifdef STDC
 #include <malloc.h>
@@ -83,10 +84,10 @@ typedef unsigned long ulg;
 
 /* Diagnostic functions */
 #ifdef DEBUG
-#include <stdio.h>
        extern int z_verbose;
        extern void z_error    OF((char *m));
 #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 Tracev(x) {if (z_verbose>0) fprintf x ;}
 #define Tracevv(x) {if (z_verbose>1) fprintf x ;}
@@ -2000,7 +2001,7 @@ void z_error (m)
     char *m;
 {
        fprintf(stderr, "%s\n", m);
-       exit(1);
+       hang ();
 }
 #endif