Added BITS_EQUAL() define.
[rsync/rsync.git] / rsync.h
diff --git a/rsync.h b/rsync.h
index e5a4019..a509242 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -70,6 +70,8 @@
 
 #define BITS_SET(val,bits) (((val) & (bits)) == (bits))
 #define BITS_SETnUNSET(val,onbits,offbits) (((val) & ((onbits)|(offbits))) == (onbits))
+#define BITS_EQUAL(b1,b2,mask) (((unsigned)(b1) & (unsigned)(mask)) \
+                            == ((unsigned)(b2) & (unsigned)(mask)))
 
 /* update this if you make incompatible changes */
 #define PROTOCOL_VERSION 30