summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_inline_init.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_inline_init.h b/src/gallium/auxiliary/util/u_inline_init.h
new file mode 100644
index 0000000000..7f2c591a3d
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_inline_init.h
@@ -0,0 +1,15 @@
+#ifndef U_INLINE_INIT_H_
+#define U_INLINE_INIT_H_
+
+#define UTIL_INLINE_INIT(m) \
+ extern boolean m##_inited; \
+ extern void m##_do_init(void); \
+ static inline void m##_init(void) \
+ { \
+ if(!m##_inited) { \
+ m##_do_init(); \
+ m##_inited = TRUE; \
+ } \
+ }
+
+#endif /* U_INLINE_INIT_H_ */