X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Ftdb.h;h=5d1d63c00f49b11befcc324df4c582c6375ede60;hp=070f09b4e19075e05f7bdfebff634d93fddcc89d;hb=1c005e1223d2f8f664ce4b3be6cd7eb4dd449844;hpb=1c7178a0a9173ff99a581475d8a9089deadcccb2 diff --git a/ccan/tdb/tdb.h b/ccan/tdb/tdb.h index 070f09b4..5d1d63c0 100644 --- a/ccan/tdb/tdb.h +++ b/ccan/tdb/tdb.h @@ -38,6 +38,7 @@ extern "C" { /* For sig_atomic_t. */ #include #endif +#include /* flags to tdb_store() */ #define TDB_REPLACE 1 /* Unused */ @@ -77,23 +78,11 @@ typedef struct TDB_DATA { size_t dsize; } TDB_DATA; -#ifndef PRINTF_ATTRIBUTE -#if (__GNUC__ >= 3) -/** Use gcc attribute to check printf fns. a1 is the 1-based index of - * the parameter containing the format, and a2 the index of the first - * argument. Note that some gcc 2.x versions don't handle this - * properly **/ -#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) -#else -#define PRINTF_ATTRIBUTE(a1, a2) -#endif -#endif - /* this is the context structure that is returned from a db open */ typedef struct tdb_context TDB_CONTEXT; typedef int (*tdb_traverse_func)(struct tdb_context *, TDB_DATA, TDB_DATA, void *); -typedef void (*tdb_log_func)(struct tdb_context *, enum tdb_debug_level, const char *, ...) PRINTF_ATTRIBUTE(3, 4); +typedef void (*tdb_log_func)(struct tdb_context *, enum tdb_debug_level, const char *, ...) PRINTF_FMT(3, 4); typedef unsigned int (*tdb_hash_func)(TDB_DATA *key); struct tdb_logging_context {