From 2d81cd41e190f106645e905cf5ec356c30c5e1a8 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 15 Apr 2025 11:05:41 -0400 Subject: Bring back TCC support! --- src/stdlib/util.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/stdlib/util.h') diff --git a/src/stdlib/util.h b/src/stdlib/util.h index 45bf1d7b..4cb1b375 100644 --- a/src/stdlib/util.h +++ b/src/stdlib/util.h @@ -19,12 +19,12 @@ #define IF_DECLARE(decl, expr, block) if (({ decl; expr ? ({ block; 1; }) : 0; })) {} -#define WHEN(subj, var, body) { auto var = subj; switch (var.$tag) body } - #ifndef auto #define auto __auto_type #endif +#define WHEN(type, subj, var, body) { type var = subj; switch (var.$tag) body } + #ifndef public #define public __attribute__ ((visibility ("default"))) #endif @@ -52,7 +52,11 @@ // 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 +#ifdef __TINYC__ +#define MACROLIKE static inline __attribute__((gnu_inline, always_inline)) +#else #define MACROLIKE extern inline __attribute__((gnu_inline, always_inline)) #endif +#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 -- cgit v1.2.3