From: Kurt Zeilenga Date: Sat, 19 Jan 2002 06:42:59 +0000 (+0000) Subject: Modify ad_cmp() macro to support use as an ordering function. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~57 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c94c7915a52f8df4323c8193ec424df568f0fc1;p=openldap Modify ad_cmp() macro to support use as an ordering function. --- diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index f0c503b915..41594bb367 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -57,8 +57,9 @@ LDAP_SLAPD_F (AttributeDescription *) ad_dup LDAP_P(( LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * )); -#define ad_cmp(l,r) (((l)->ad_cname.bv_len == (r)->ad_cname.bv_len) \ - ? strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val ) : 1 ) +#define ad_cmp(l,r) (((l)->ad_cname.bv_len < (r)->ad_cname.bv_len) \ + ? -1 : (((l)->ad_cname.bv_len > (r)->ad_cname.bv_len) \ + ? strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val ) : 1 )) LDAP_SLAPD_F (int) is_ad_subtype LDAP_P(( AttributeDescription *sub,