summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-06-10 16:22:49 +0100
committerJosé Fonseca <[email protected]>2010-06-14 16:50:39 +0100
commit91bbe466c7a149d1f9d1cc9bd27f8aedb45b9d2e (patch)
treeed8fb326ca595b970ff35ebceedc80844db4ff64 /src/gallium
parent5d5fa34757382e4d1d6ca0d3825bd16c9a8f3d72 (diff)
util: Add a func_to_pointer util function too.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_pointer.h11
1 files changed, 11 insertions, 0 deletions
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
}