aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/bytes.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-15 19:59:14 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-15 19:59:14 -0400
commite5420471a7364a92521575e7abd3a29a9318001b (patch)
tree6b7aaccff3d033fdc49cee41874071637fa8b68e /src/stdlib/bytes.c
parentc3615dc92c667899af7a11b2b25201dad5502ee6 (diff)
Make some compatibility fixes to make sure the compiler can fully build
using TinyCC
Diffstat (limited to 'src/stdlib/bytes.c')
-rw-r--r--src/stdlib/bytes.c7
1 files changed, 6 insertions, 1 deletions
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;