aboutsummaryrefslogtreecommitdiff
path: root/stdlib/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/util.h')
-rw-r--r--stdlib/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/util.h b/stdlib/util.h
index 9e83c2bc..fb708476 100644
--- a/stdlib/util.h
+++ b/stdlib/util.h
@@ -37,6 +37,12 @@
#define INLINE inline __attribute__ ((always_inline))
#endif
+// GCC lets you define macro-like functions which are always inlined and never
+// compiled using this combination of flags. See: https://gcc.gnu.org/onlinedocs/gcc/Inline.html
+#ifndef MACROLIKE
+#define MACROLIKE extern inline __attribute__((gnu_inline, always_inline))
+#endif
+
__attribute__((format(printf, 1, 2)))
char *heap_strf(const char *fmt, ...);