diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-15 11:05:41 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-15 11:05:41 -0400 |
| commit | 2d81cd41e190f106645e905cf5ec356c30c5e1a8 (patch) | |
| tree | 516c02934c48f6e77869e708211bbdad96e44f64 /src/stdlib/util.h | |
| parent | 4a604a298c0cde9667c483e93106a209b4cd3055 (diff) | |
Bring back TCC support!
Diffstat (limited to 'src/stdlib/util.h')
| -rw-r--r-- | src/stdlib/util.h | 8 |
1 files changed, 6 insertions, 2 deletions
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 |
