From e5420471a7364a92521575e7abd3a29a9318001b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 15 Apr 2025 19:59:14 -0400 Subject: Make some compatibility fixes to make sure the compiler can fully build using TinyCC --- src/stdlib/bytes.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/stdlib/bytes.c') diff --git a/src/stdlib/bytes.c b/src/stdlib/bytes.c index b543c7c6..fffce06c 100644 --- a/src/stdlib/bytes.c +++ b/src/stdlib/bytes.c @@ -10,8 +10,9 @@ public const Byte_t Byte$min = 0; public const Byte_t Byte$max = UINT8_MAX; -PUREFUNC public Text_t Byte$as_text(const void *b, bool colorize, const TypeInfo_t*) +PUREFUNC public Text_t Byte$as_text(const void *b, bool colorize, const TypeInfo_t *info) { + (void)info; if (!b) return Text("Byte"); return Text$format(colorize ? "\x1b[35m0x%02X\x1b[m" : "0x%02X", *(Byte_t*)b); } @@ -34,6 +35,10 @@ public Text_t Byte$hex(Byte_t byte, bool uppercase, bool prefix) { return text; } +#ifdef __TINYC__ +#define __builtin_add_overflow(x, y, result) ({ *(result) = (x) + (y); false; }) +#endif + typedef struct { OptionalByte_t current, last; Int8_t step; -- cgit v1.2.3