#include <string.h>
#include <ccan/compiler/compiler.h>
#include <assert.h>
-#ifdef DEBUG
+#ifdef CCAN_JMAP_DEBUG
#include <stdio.h>
#endif
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;
};
-const char *COLD_ATTRIBUTE jmap_error_(struct jmap *map);
+const char *COLD jmap_error_(struct jmap *map);
/* Debugging checks. */
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;
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
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",