summaryrefslogtreecommitdiff
path: root/lib/util/tsort.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-14 10:37:20 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-14 18:44:20 +1100
commit282cc79454f7b708085a04d04e98d11ffec8b293 (patch)
treed91205910306d6a7f39dc3a10e283405a701bee2 /lib/util/tsort.h
parent0c39fbc94ed6ad3aa18a6b3c15743707236f35c3 (diff)
downloadsamba-282cc79454f7b708085a04d04e98d11ffec8b293.tar.gz
samba-282cc79454f7b708085a04d04e98d11ffec8b293.tar.bz2
samba-282cc79454f7b708085a04d04e98d11ffec8b293.zip
s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code
Diffstat (limited to 'lib/util/tsort.h')
-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