summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include
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 /source4/lib/ldb/include
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 'source4/lib/ldb/include')
-rw-r--r--source4/lib/ldb/include/ldb.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 26a196f311..fc5d47ac32 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -2002,6 +2002,17 @@ do { \
} \
} while (0)
+/* allow ldb to also call TYPESAFE_QSORT() */
+#ifndef TYPESAFE_QSORT
+#define TYPESAFE_QSORT(base, numel, comparison) \
+do { \
+ if (numel > 1) { \
+ qsort(base, numel, sizeof((base)[0]), (int (*)(const void *, const void *))comparison); \
+ comparison(&((base)[0]), &((base)[1])); \
+ } \
+} while (0)
+#endif
+
/**