+#include "config.h"
#include <string.h>
#include <stdio.h>
-#include "config.h"
/**
* likely - macros for annotating likely/unlikely branches in the code
* help you annotate rare paths in your code for the convenience of the
* compiler and the reader.
*
- * Licence: LGPL (2 or any later version)
+ * With CCAN_LIKELY_DEBUG defined, it provides statistics for each
+ * likely()/unlikely() call (but note that this requires LGPL dependencies).
+ *
+ * License: CC0 (Public domain)
+ * Author: Rusty Russell <rusty@rustcorp.com.au>
*
* Example:
* #include <ccan/likely/likely.h>
return 1;
if (strcmp(argv[1], "depends") == 0) {
+#ifdef CCAN_LIKELY_DEBUG
printf("ccan/str\n");
- printf("ccan/hashtable\n");
+ printf("ccan/htable\n");
printf("ccan/hash\n");
+#endif
+ return 0;
+ }
+ if (strcmp(argv[1], "testdepends") == 0) {
+#ifndef CCAN_LIKELY_DEBUG
+ printf("ccan/str\n");
+ printf("ccan/htable\n");
+ printf("ccan/hash\n");
+#endif
return 0;
}
-
return 1;
}