- cast_if_type((cmp), \
- int (*)(const __typeof__(*(base)) *, \
- const __typeof__(*(base)) *, \
- __typeof__(ctx)), \
- int (*)(const void *, const void *, const void *)), (ctx))
-#else
-#define asort(base, num, cmp, ctx) \
- _asort((base), (num), sizeof(*(base)), \
- (int (*)(const void *, const void *, const void *))(cmp), ctx)
-#endif
+ typesafe_cb_cast(int (*)(const void *, const void *, void *), \
+ int (*)(const __typeof__(*(base)) *, \
+ const __typeof__(*(base)) *, \
+ __typeof__(ctx)), \
+ (cmp)), \
+ (ctx))