X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=include%2Fmemcached.h;h=1131de2baff3c4d47469ca4e5c2f5dd025f2c177;hb=d34fb751640d8d89dfdde229aeb7d508dc458d0c;hp=a705550ed9edd73d821eff47c3b2f03b1b06e8b6;hpb=8f27b5fa655ee8ebf7020ef91001cbe56d0b6537;p=m6w6%2Flibmemcached diff --git a/include/memcached.h b/include/memcached.h index a705550e..1131de2b 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -12,6 +12,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -210,11 +211,29 @@ char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat, memcached_return *error); /* Some personal debugging functions */ -#define WATCHPOINT printf("\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); -#define WATCHPOINT_ERROR(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); -#define WATCHPOINT_STRING(A) printf("\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); -#define WATCHPOINT_NUMBER(A) printf("\nWATCHPOINT %s:%d (%s) %d\n", __FILE__, __LINE__,__func__,A);fflush(stdout); -#define WATCHPOINT_ERRNO(A) printf("\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));A= 0;fflush(stdout); +#ifdef HAVE_DEBUG +#define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); +#define WATCHPOINT_ERROR(A) fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); +#define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); +#define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout); +#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));A= 0;fflush(stdout); +#define WATCHPOINT_ASSERT(A) assert((A)); +#else +/* +#define WATCHPOINT { 1; }; +#define WATCHPOINT_ERROR(A) { 1; }; +#define WATCHPOINT_STRING(A) { 1; }; +#define WATCHPOINT_NUMBER(A) { 1; }; +#define WATCHPOINT_ERRNO(A) { 1; }; +#define WATCHPOINT_ASSERT(A) { 1; }; +*/ +#define WATCHPOINT +#define WATCHPOINT_ERROR(A) +#define WATCHPOINT_STRING(A) +#define WATCHPOINT_NUMBER(A) +#define WATCHPOINT_ERRNO(A) +#define WATCHPOINT_ASSERT(A) +#endif #ifdef __cplusplus