Added BITS_EQUAL() define.
authorWayne Davison <wayned@samba.org>
Tue, 12 Dec 2006 20:17:02 +0000 (20:17 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 12 Dec 2006 20:17:02 +0000 (20:17 +0000)
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