diff --git a/tccgen.c b/tccgen.c index e17597a3..a177c5ad 100644 --- a/tccgen.c +++ b/tccgen.c @@ -4709,8 +4709,16 @@ static int parse_btype(CType *type, AttributeDef *ad, int ignore_label) case TOK_COMPLEX: tcc_error("_Complex is not yet supported"); case TOK_FLOAT: + /* macOS SDK uses it in math.h + fake the size and alignment + */ u = VT_FLOAT; + /* tcc_warning("_Float16 is not yet supported. Skipped."); + I hope no one really uses it in the wild. */ goto basic_type; + case TOK_FLOAT16: + u = VT_SHORT; + case TOK_DOUBLE: if ((t & (VT_BTYPE|VT_LONG)) == VT_LONG) { t = (t & ~(VT_BTYPE|VT_LONG)) | VT_LDOUBLE; diff --git a/tcctok.h b/tcctok.h index bcd67f19..204df022 100644 --- a/tcctok.h +++ b/tcctok.h @@ -67,6 +67,7 @@ DEF(TOK_TYPEOF2, "__typeof") DEF(TOK_TYPEOF3, "__typeof__") DEF(TOK_LABEL, "__label__") + DEF(TOK_FLOAT16, "_Float16") #ifdef TCC_TARGET_ARM64 DEF(TOK_UINT128, "__uint128_t")