aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rin/definitions.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/rin/definitions.h b/include/rin/definitions.h
index bc417b5..8364f42 100644
--- a/include/rin/definitions.h
+++ b/include/rin/definitions.h
@@ -29,4 +29,13 @@
# define WEAK_SYM
#endif
+#define rin_once(func) \
+do { \
+ static unsigned int __rin_firstrun = 1; \
+ if (__rin_firstrun) { \
+ --__rin_firstrun; \
+ func; \
+ } \
+} while (0)
+
#endif /* LIBRIN_DEFINITIONS_INCLUDED */