First merge of Trond's patches (cherry picking).
[m6w6/libmemcached] / libmemcached / memcached_watchpoint.h
index d61aadfd8335223d403642a75416874f70bcfbe1..d8c593ec595cce88e30bf1ff58aaf3d9bc9c1b4a 100644 (file)
@@ -1,21 +1,20 @@
-/*
- * Summary: Localized copy of WATCHPOINT debug symbols
+/* LibMemcached
+ * Copyright (C) 2006-2009 Brian Aker 
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license.  See
+ * the COPYING file in the parent directory for full text.
  *
- * Copy: See Copyright for the status of this software.
+ * Summary: Localized copy of WATCHPOINT debug symbols
  *
- * 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 <assert.h>
 
 #define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
@@ -27,7 +26,10 @@ extern "C" {
 #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));
+#define WATCHPOINT_ASSERT_INITIALIZED(A) (memcached_is_initialized((A));
+
 #else
+
 #define WATCHPOINT
 #define WATCHPOINT_ERROR(A)
 #define WATCHPOINT_IFERROR(A)
@@ -36,11 +38,8 @@ extern "C" {
 #define WATCHPOINT_ERRNO(A)
 #define WATCHPOINT_ASSERT_PRINT(A,B,C)
 #define WATCHPOINT_ASSERT(A)
-#endif
-#endif /* MEMCACHED_INTERNAL */
+#define WATCHPOINT_ASSERT_INITIALIZED(A)
 
-#ifdef __cplusplus
-}
-#endif
+#endif /* DEBUG */
 
-#endif /* __MEMCACHED_WATCHPOINT_H__ */
+#endif /* LIBMEMCACHED_MEMCACHED_WATCHPOINT_H */