From 04c2a22175d7c27ee380f986eece2772eddd6fcc Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 21 Aug 2010 10:34:42 +0100 Subject: util: Make the reference debuggin code more C++ friendly. C++ doesn't accept function <-> void* conversions without a putting a fight. --- src/gallium/auxiliary/util/u_debug_refcnt.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/gallium/auxiliary/util/u_debug_refcnt.h') 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 -- cgit v1.2.3