don't use WRAP as that maybe be defined in standard includes
[rsync/rsync.git] / lib / zlib.c
index 9d96513..c9f7ff5 100644 (file)
@@ -3089,9 +3089,9 @@ struct inflate_blocks_state {
 /*   output bytes */
 #define WAVAIL (q<s->read?s->read-q-1:s->end-q)
 #define LOADOUT {q=s->write;m=WAVAIL;}
-#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=WAVAIL;}}
+#define ZWRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=WAVAIL;}}
 #define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
-#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define NEEDOUT {if(m==0){ZWRAP if(m==0){FLUSH ZWRAP if(m==0) LEAVE}}r=Z_OK;}
 #define OUTBYTE(a) {*q++=(Byte)(a);m--;}
 /*   load local pointers */
 #define LOAD {LOADIN LOADOUT}
@@ -3552,7 +3552,7 @@ z_stream *z;
        n -= t;
        z->total_out += t;
        s->read = q;    /* drag read pointer forward */
-/*      WRAP  */       /* expand WRAP macro by hand to handle s->read */
+/*      ZWRAP  */      /* expand ZWRAP macro by hand to handle s->read */
        if (q == s->end) {
            s->read = q = s->window;
            m = WAVAIL;
@@ -3943,7 +3943,9 @@ z_stream *z;            /* for zfree function */
 
 
 /* build fixed tables only once--keep them here */
-local int fixed_lock = 0;
+#ifdef MULTI_THREADED
+local volatile int fixed_lock = 0;
+#endif
 local int fixed_built = 0;
 #define FIXEDH 530      /* number of hufts used by fixed tables */
 local uInt fixed_left = FIXEDH;
@@ -3984,8 +3986,10 @@ inflate_huft * FAR *tl;  /* literal/length tree result */
 inflate_huft * FAR *td;  /* distance tree result */
 {
   /* build fixed tables if not built already--lock out other instances */
+#ifdef MULTI_THREADED
   while (++fixed_lock > 1)
     fixed_lock--;
+#endif
   if (!fixed_built)
   {
     int k;              /* temporary variable */
@@ -4018,7 +4022,9 @@ inflate_huft * FAR *td;  /* distance tree result */
     /* done */
     fixed_built = 1;
   }
+#ifdef MULTI_THREADED
   fixed_lock--;
+#endif
   *bl = fixed_bl;
   *bd = fixed_bd;
   *tl = fixed_tl;