Unified · Split
| @@ -379,7 +379,7 @@ static uint8_t fastcallw_regs[2] = { TREG_ECX, TREG_EDX }; · 378 unmodified lines | |||
| 379 | returning via struct pointer. */ | 379 | returning via struct pointer. */ |
| 380 | ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize) | 380 | ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize) |
| 381 | { | 381 | { |
| 382 | #ifdef TCC_TARGET_PE | 382 | #if defined(TCC_TARGET_PE) || TARGETOS_FreeBSD |
| 383 | int size, align; | 383 | int size, align; |
| 384 | *ret_align = 1; // Never have to re-align return values for x86 | 384 | *ret_align = 1; // Never have to re-align return values for x86 |
| 385 | *regsize = 4; | 385 | *regsize = 4; |
| @@ -501,7 +501,7 @@ ST_FUNC void gfunc_call(int nb_args) · 115 unmodified lines | |||
| 501 | args_size -= 4; | 501 | args_size -= 4; |
| 502 | } | 502 | } |
| 503 | } | 503 | } |
| 504 | #ifndef TCC_TARGET_PE | 504 | #if !defined(TCC_TARGET_PE) && !TARGETOS_FreeBSD |
| 505 | else if ((vtop->type.ref->type.t & VT_BTYPE) == VT_STRUCT) | 505 | else if ((vtop->type.ref->type.t & VT_BTYPE) == VT_STRUCT) |
| 506 | args_size -= 4; | 506 | args_size -= 4; |
| 507 | #endif | 507 | #endif |
| @@ -551,7 +551,7 @@ ST_FUNC void gfunc_prolog(Sym *func_sym) · 43 unmodified lines | |||
| 551 | func_sub_sp_offset = ind; | 551 | func_sub_sp_offset = ind; |
| 552 | /* if the function returns a structure, then add an | 552 | /* if the function returns a structure, then add an |
| 553 | implicit pointer parameter */ | 553 | implicit pointer parameter */ |
| 554 | #ifdef TCC_TARGET_PE | 554 | #if defined(TCC_TARGET_PE) || TARGETOS_FreeBSD |
| 555 | size = type_size(&func_vt,&align); | 555 | size = type_size(&func_vt,&align); |
| 556 | if (((func_vt.t & VT_BTYPE) == VT_STRUCT) | 556 | if (((func_vt.t & VT_BTYPE) == VT_STRUCT) |
| 557 | && (size > 8 || (size & (size - 1)))) { | 557 | && (size > 8 || (size & (size - 1)))) { |
| @@ -592,7 +592,7 @@ ST_FUNC void gfunc_prolog(Sym *func_sym) · 34 unmodified lines | |||
| 592 | /* pascal type call or fastcall ? */ | 592 | /* pascal type call or fastcall ? */ |
| 593 | if (func_call == FUNC_STDCALL || func_call == FUNC_FASTCALLW) | 593 | if (func_call == FUNC_STDCALL || func_call == FUNC_FASTCALLW) |
| 594 | func_ret_sub = addr - 8; | 594 | func_ret_sub = addr - 8; |
| 595 | #ifndef TCC_TARGET_PE | 595 | #if !defined(TCC_TARGET_PE) && !TARGETOS_FreeBSD |
| 596 | else if (func_vc) | 596 | else if (func_vc) |
| 597 | func_ret_sub = 4; | 597 | func_ret_sub = 4; |
| 598 | #endif | 598 | #endif |