-#define BT_ASSERT_PRE_NON_NULL(_obj, _obj_name) \
- BT_ASSERT_PRE((_obj) != NULL, "%s is NULL: ", _obj_name)
+#define BT_ASSERT_PRE_VALID_INDEX(_index, _length) \
+ BT_ASSERT_PRE((_index) < (_length), \
+ "Index is out of bounds: index=%" PRIu64 ", " \
+ "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
+
+#ifdef BT_DEV_MODE
+/* Developer mode version of BT_ASSERT_PRE_MSG(). */
+# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...) \
+ BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_PRE(). */
+# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...) \
+ BT_ASSERT_PRE((_cond), _fmt, ##__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_PRE_NON_NULL() */
+# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
+ BT_ASSERT_PRE_NON_NULL((_obj), (_obj_name))