mirror of
git://repo.or.cz/tinycc.git
synced 2026-11-04 21:26:36 +08:00
Add fake _Float16 type to enable the latest math.h on macOS
Some checks are pending
build and test / test-x86_64-linux (push) Waiting to run
build and test / test-x86_64-osx (push) Waiting to run
build and test / test-aarch64-osx (push) Waiting to run
build and test / test-x86-win32 (push) Waiting to run
build and test / test-armv7-linux (push) Waiting to run
build and test / test-aarch64-linux (push) Waiting to run
build and test / test-riscv64-linux (push) Waiting to run
Some checks are pending
build and test / test-x86_64-linux (push) Waiting to run
build and test / test-x86_64-osx (push) Waiting to run
build and test / test-aarch64-osx (push) Waiting to run
build and test / test-x86-win32 (push) Waiting to run
build and test / test-armv7-linux (push) Waiting to run
build and test / test-aarch64-linux (push) Waiting to run
build and test / test-riscv64-linux (push) Waiting to run
This commit is contained in:
parent
8c4e67380e
commit
a06c608625
8
tccgen.c
8
tccgen.c
@ -4709,8 +4709,16 @@ static int parse_btype(CType *type, AttributeDef *ad, int ignore_label)
|
|||||||
case TOK_COMPLEX:
|
case TOK_COMPLEX:
|
||||||
tcc_error("_Complex is not yet supported");
|
tcc_error("_Complex is not yet supported");
|
||||||
case TOK_FLOAT:
|
case TOK_FLOAT:
|
||||||
|
/* macOS SDK uses it in math.h
|
||||||
|
fake the size and alignment
|
||||||
|
*/
|
||||||
u = VT_FLOAT;
|
u = VT_FLOAT;
|
||||||
|
/* tcc_warning("_Float16 is not yet supported. Skipped.");
|
||||||
|
I hope no one really uses it in the wild. */
|
||||||
goto basic_type;
|
goto basic_type;
|
||||||
|
case TOK_FLOAT16:
|
||||||
|
u = VT_SHORT;
|
||||||
|
|
||||||
case TOK_DOUBLE:
|
case TOK_DOUBLE:
|
||||||
if ((t & (VT_BTYPE|VT_LONG)) == VT_LONG) {
|
if ((t & (VT_BTYPE|VT_LONG)) == VT_LONG) {
|
||||||
t = (t & ~(VT_BTYPE|VT_LONG)) | VT_LDOUBLE;
|
t = (t & ~(VT_BTYPE|VT_LONG)) | VT_LDOUBLE;
|
||||||
|
|||||||
1
tcctok.h
1
tcctok.h
@ -67,6 +67,7 @@
|
|||||||
DEF(TOK_TYPEOF2, "__typeof")
|
DEF(TOK_TYPEOF2, "__typeof")
|
||||||
DEF(TOK_TYPEOF3, "__typeof__")
|
DEF(TOK_TYPEOF3, "__typeof__")
|
||||||
DEF(TOK_LABEL, "__label__")
|
DEF(TOK_LABEL, "__label__")
|
||||||
|
DEF(TOK_FLOAT16, "_Float16")
|
||||||
|
|
||||||
#ifdef TCC_TARGET_ARM64
|
#ifdef TCC_TARGET_ARM64
|
||||||
DEF(TOK_UINT128, "__uint128_t")
|
DEF(TOK_UINT128, "__uint128_t")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user