#define typesafe_bsearch_r(k, b, n, func, userdata) \
({ \
- const typeof(b[0]) *_k = k; \
- int (*_func_)(const typeof(b[0])*, const typeof(b[0])*, typeof(userdata)) = func; \
+ const typeof((b)[0]) *_k = k; \
+ int (*_func_)(const typeof((b)[0])*, const typeof((b)[0])*, typeof(userdata)) = func; \
xbsearch_r((const void*) _k, (b), (n), sizeof((b)[0]), (comparison_userdata_fn_t) _func_, userdata); \
})
#define typesafe_bsearch(k, b, n, func) \
({ \
- const typeof(b[0]) *_k = k; \
- int (*_func_)(const typeof(b[0])*, const typeof(b[0])*) = func; \
+ const typeof((b)[0]) *_k = k; \
+ int (*_func_)(const typeof((b)[0])*, const typeof((b)[0])*) = func; \
bsearch_safe((const void*) _k, (b), (n), sizeof((b)[0]), (comparison_fn_t) _func_); \
})
* is the prototype for the comparison function */
#define typesafe_qsort(p, n, func) \
({ \
- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*) = func; \
+ int (*_func_)(const typeof((p)[0])*, const typeof((p)[0])*) = func; \
_qsort_safe((p), (n), sizeof((p)[0]), (comparison_fn_t) _func_); \
})
#define typesafe_qsort_r(p, n, func, userdata) \
({ \
- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \
+ int (*_func_)(const typeof((p)[0])*, const typeof((p)[0])*, typeof(userdata)) = func; \
qsort_r_safe((p), (n), sizeof((p)[0]), (comparison_userdata_fn_t) _func_, userdata); \
})