From: José Fonseca Date: Thu, 10 Jun 2010 15:22:49 +0000 (+0100) Subject: util: Add a func_to_pointer util function too. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91bbe466c7a149d1f9d1cc9bd27f8aedb45b9d2e;p=mesa.git util: Add a func_to_pointer util function too. --- 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 }