]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/idl.h
Merge remote branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / servers / slapd / back-bdb / idl.h
index 29a0aaf629c799dade092f7422150b9a553d87bb..143ec48b145015753fc95e0c9b26f6067919ec9f 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2008 The OpenLDAP Foundation.
+ * Copyright 2000-2012 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #define BDB_IDL_ID( bdb, ids, id ) BDB_IDL_RANGE( ids, id, ((bdb)->bi_lastid) )
 #define BDB_IDL_ALL( bdb, ids ) BDB_IDL_RANGE( ids, 1, ((bdb)->bi_lastid) )
 
-#define BDB_IDL_FIRST( ids )   ( ids[1] )
+#define BDB_IDL_FIRST( ids )   ( (ids)[1] )
 #define BDB_IDL_LAST( ids )            ( BDB_IDL_IS_RANGE(ids) \
-       ? ids[2] : ids[ids[0]] )
+       ? (ids)[2] : (ids)[(ids)[0]] )
 
 #define BDB_IDL_N( ids )               ( BDB_IDL_IS_RANGE(ids) \
-       ? (ids[2]-ids[1])+1 : ids[0] )
+       ? ((ids)[2]-(ids)[1])+1 : (ids)[0] )
 
 LDAP_BEGIN_DECL
 LDAP_END_DECL