summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_debug_refcnt.h
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-08-21 10:34:42 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-08-21 10:34:42 +0100
commit04c2a22175d7c27ee380f986eece2772eddd6fcc (patch)
treeac3f47954c9a65ac27b450f5fb7459d70d74caf2 /src/gallium/auxiliary/util/u_debug_refcnt.h
parent7a40d15e6c6b8ebc971be0e926c7027a85db96a0 (diff)
util: Make the reference debuggin code more C++ friendly.
C++ doesn't accept function <-> void* conversions without a putting a fight.
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug_refcnt.h')
-rw-r--r--src/gallium/auxiliary/util/u_debug_refcnt.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.h b/src/gallium/auxiliary/util/u_debug_refcnt.h
index ba40999bf2..4c4a18ecf9 100644
--- a/src/gallium/auxiliary/util/u_debug_refcnt.h
+++ b/src/gallium/auxiliary/util/u_debug_refcnt.h
@@ -15,19 +15,26 @@
extern "C" {
#endif
+typedef void (*debug_reference_descriptor)(char*, const struct pipe_reference*);
+
#if defined(DEBUG) && (!defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_WINDOWS_USER))
+
extern int debug_refcnt_state;
-void debug_reference_slowpath(const struct pipe_reference* p, void* get_desc, int change);
+void debug_reference_slowpath(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change);
-static INLINE void debug_reference(const struct pipe_reference* p, void* get_desc, int change)
+static INLINE void debug_reference(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
{
- if(debug_refcnt_state >= 0)
- debug_reference_slowpath(p, get_desc, change);
+ if (debug_refcnt_state >= 0)
+ debug_reference_slowpath(p, get_desc, change);
}
+
#else
-static INLINE void debug_reference(const struct pipe_reference* p, void* get_desc, const char* op)
-{}
+
+static INLINE void debug_reference(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
+{
+}
+
#endif
#ifdef __cplusplus