]> git.ozlabs.org Git - ccan/blobdiff - ccan/order/test/compile_fail_2.c
order: Module for comparison callbacks
[ccan] / ccan / order / test / compile_fail_2.c
diff --git a/ccan/order/test/compile_fail_2.c b/ccan/order/test/compile_fail_2.c
new file mode 100644 (file)
index 0000000..5a7126d
--- /dev/null
@@ -0,0 +1,25 @@
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <ccan/order/order.h>
+
+#include "fancy_cmp.h"
+
+#ifdef FAIL
+typedef int ctx_t;
+#else
+typedef struct cmp_info ctx_t;
+#endif
+
+int main(int argc, char *argv[])
+{
+       total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp;
+       _total_order_cb cb1 = total_order_cast(fancy_cmp, struct item,
+                                              ctx_t *);
+
+       printf("%p %p\n", cb0, cb1);
+
+       exit(0);
+
+}