From bdca4fc6e1d3a9ce1306313528067f012a60341b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 30 Oct 2024 13:59:15 -0400 Subject: Fix header inline functions to use `extern inline` and some GCC magic --- stdlib/util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stdlib/util.h') 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, ...); -- cgit v1.2.3