X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Flikely%2F_info;h=095ed2f7b472e7d4aeaab22099182d911e631c9c;hb=c8f5d9df177cb3326c2b27909b9925521490c7b9;hp=d72aa5586f967af9eb498de8a1f1f5fc7779bbf3;hpb=9f8c65b28acba8e5eabea5d7abd98b19e62d06fe;p=ccan diff --git a/ccan/likely/_info b/ccan/likely/_info index d72aa558..095ed2f7 100644 --- a/ccan/likely/_info +++ b/ccan/likely/_info @@ -1,6 +1,6 @@ +#include "config.h" #include #include -#include "config.h" /** * likely - macros for annotating likely/unlikely branches in the code @@ -9,7 +9,11 @@ * 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 * * Example: * #include @@ -34,11 +38,20 @@ int main(int argc, char *argv[]) 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; }