From 91bbe466c7a149d1f9d1cc9bd27f8aedb45b9d2e Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 10 Jun 2010 16:22:49 +0100 Subject: util: Add a func_to_pointer util function too. --- src/gallium/auxiliary/util/u_pointer.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gallium/auxiliary') diff --git a/src/gallium/auxiliary/util/u_pointer.h b/src/gallium/auxiliary/util/u_pointer.h index ae6f43bff87..cce0c7430e7 100644 --- a/src/gallium/auxiliary/util/u_pointer.h +++ b/src/gallium/auxiliary/util/u_pointer.h @@ -111,6 +111,17 @@ pointer_to_func( void *p ) return pf.f; } +static INLINE void * +func_to_pointer( func_pointer f ) +{ + union { + void *p; + func_pointer f; + } pf; + pf.f = f; + return pf.p; +} + #ifdef __cplusplus } -- cgit v1.2.3