summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/tsort.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/util/tsort.h b/lib/util/tsort.h
index 236b369912..811d6cd2f7 100644
--- a/lib/util/tsort.h
+++ b/lib/util/tsort.h
@@ -27,12 +27,14 @@
a wrapper around qsort() that ensures the comparison function is
type safe.
*/
+#ifndef TYPESAFE_QSORT
#define TYPESAFE_QSORT(base, numel, comparison) \
do { \
if (numel > 1) { \
- qsort(base, numel, sizeof((base)[0]), QSORT_CAST comparison); \
+ qsort(base, numel, sizeof((base)[0]), (int (*)(const void *, const void *))comparison); \
assert(comparison(&((base)[0]), &((base)[1])) <= 0); \
} \
} while (0)
+#endif
#endif