X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_watchpoint.h;h=dc8045aa0d029a187ff04b263f3c111c7c96d81a;hb=67f0779a5c91cde63c1da8240a9f4d95509d3273;hp=e87b0b04f7a5d9d2a0c4a4f5560445600f74ee9c;hpb=fed759289b7835fcf310cd0e940fed56962aa9ba;p=awesomized%2Flibmemcached diff --git a/libmemcached/memcached_watchpoint.h b/libmemcached/memcached_watchpoint.h index e87b0b04..dc8045aa 100644 --- a/libmemcached/memcached_watchpoint.h +++ b/libmemcached/memcached_watchpoint.h @@ -6,16 +6,12 @@ * Author: Brian Aker */ -#ifndef __MEMCACHED_WATCHPOINT_H__ -#define __MEMCACHED_WATCHPOINT_H__ - -#ifdef __cplusplus -extern "C" { -#endif +#ifndef LIBMEMCACHED_MEMCACHED_WATCHPOINT_H +#define LIBMEMCACHED_MEMCACHED_WATCHPOINT_H /* Some personal debugging functions */ -#ifdef MEMCACHED_INTERNAL -#ifdef HAVE_DEBUG +#if defined(DEBUG) + #include #define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); @@ -25,6 +21,7 @@ extern "C" { #define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,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));fflush(stdout); +#define WATCHPOINT_ASSERT_PRINT(A,B,C) if(!(A)){fprintf(stderr, "\nWATCHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C));fprintf(stderr,"\n");fflush(stdout);}assert((A)); #define WATCHPOINT_ASSERT(A) assert((A)); #else #define WATCHPOINT @@ -33,12 +30,9 @@ extern "C" { #define WATCHPOINT_STRING(A) #define WATCHPOINT_NUMBER(A) #define WATCHPOINT_ERRNO(A) +#define WATCHPOINT_ASSERT_PRINT(A,B,C) #define WATCHPOINT_ASSERT(A) -#endif -#endif /* MEMCACHED_INTERNAL */ -#ifdef __cplusplus -} -#endif +#endif /* DEBUG */ -#endif /* __MEMCACHED_WATCHPOINT_H__ */ +#endif /* LIBMEMCACHED_MEMCACHED_WATCHPOINT_H */