]> git.ozlabs.org Git - ccan/blobdiff - ccan/jmap/jmap.h
tdb2: don't cancel transactions on lock failures in tdb1 backend.
[ccan] / ccan / jmap / jmap.h
index cfa2e26c61512fa07951f5e3101cc3be843354b7..26a8d339bd582e40e265759e8bfb4069dda0771d 100644 (file)
@@ -1,3 +1,4 @@
+/* Licensed under LGPLv2.1+ - see LICENSE file for details */
 #ifndef CCAN_JMAP_H
 #define CCAN_JMAP_H
 #include <stddef.h>
@@ -6,7 +7,7 @@
 #include <string.h>
 #include <ccan/compiler/compiler.h>
 #include <assert.h>
-#ifdef DEBUG
+#ifdef CCAN_JMAP_DEBUG
 #include <stdio.h>
 #endif
 
@@ -39,7 +40,7 @@ struct jmap {
        const char *errstr;
        /* Used if !NDEBUG */
        int num_accesses;
-       /* Used if DEBUG */
+       /* Used if CCAN_JMAP_DEBUG */
        unsigned long *acc_value;
        unsigned long acc_index;
        const char *funcname;
@@ -52,7 +53,7 @@ static inline void jmap_debug_add_access(const struct jmap *map,
                                         unsigned long *val,
                                         const char *funcname)
 {
-#ifdef DEBUG
+#ifdef CCAN_JMAP_DEBUG
        if (!map->acc_value) {
                ((struct jmap *)map)->acc_value = val;
                ((struct jmap *)map)->acc_index = index;
@@ -66,7 +67,7 @@ static inline void jmap_debug_add_access(const struct jmap *map,
 static inline void jmap_debug_del_access(struct jmap *map, unsigned long **val)
 {
        assert(--map->num_accesses >= 0);
-#ifdef DEBUG
+#ifdef CCAN_JMAP_DEBUG
        if (map->acc_value == *val)
                map->acc_value = NULL;
 #endif
@@ -76,7 +77,7 @@ static inline void jmap_debug_del_access(struct jmap *map, unsigned long **val)
 
 static inline void jmap_debug_access(struct jmap *map)
 {
-#ifdef DEBUG
+#ifdef CCAN_JMAP_DEBUG
        if (map->num_accesses && map->acc_value)
                fprintf(stderr,
                        "jmap: still got index %lu, val %lu (%p) from %s\n",