1
0
forked from alex-eg/sex

promote the prelude's integer types like C's own

u8 and i32 are typedefs of <stdint.h> names nothing parses, so they had
no rank: (+ a a) over two u8 200s was a u8 holding 144, and (+ n 1) over
an i32 could not be typed at all.
This commit is contained in:
2026-10-16 13:54:41 +03:00
parent 6d84553652
commit 5cd931cb4e
3 changed files with 25 additions and 3 deletions

View File

@@ -42,14 +42,17 @@
#f
(get-fields 't-color))
(add-typedef 't-u8 '(typedef t-u8 uint8-t))
(add-typedef 't-u8 '(typedef t-u8 gl-ubyte))
(test "a typedef resolves to its target"
'uint8-t
'gl-ubyte
(get-underlying-type 't-u8))
(add-typedef 't-byte '(typedef t-byte t-u8))
(test "and chains are followed to the end"
'uint8-t
'gl-ubyte
(get-underlying-type 't-byte))
(test "stdint.h's exact-width types are C's own"
'(unsigned char)
(get-underlying-type 'uint8-t))
(test "a struct is not a typedef"
#f
(get-underlying-type 't-point))