From 282cc79454f7b708085a04d04e98d11ffec8b293 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Feb 2010 10:37:20 +1100 Subject: s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code --- lib/util/tsort.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit