* rb_node will have an alignment of 4 or 8 bytes.
*/
uintptr_t rb_info;
-#define RB_FLAG_POSITION (uintptr_t)0x2
-#define RB_FLAG_RED (uintptr_t)0x1
+#define RB_FLAG_POSITION __BIT(1)
+#define RB_FLAG_RED __BIT(0)
#define RB_FLAG_MASK (RB_FLAG_POSITION|RB_FLAG_RED)
#define RB_FATHER(rb) \
((struct rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
#define HOSTNAME_MAX_LEN 250 /* 255 - 3 (FQDN) - 2 (DNS enc) */
#endif
+#ifndef __BIT
+#define __BIT(__n) \
+ (((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \
+ ((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1))))
+#endif
+
#ifndef MIN
#define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b))
#define MAX(a,b) ((/*CONSTCOND*/(a)>(b))?(a):(b))