14 typedef void* voidp_t
;
15 typedef void (*funp_t
)(void);
17 volatile data_t mydata
;
19 long varargs(char i
, ...)
27 case 1: ret
= (long)va_arg(arg
, voidp_t
); break;
28 case 2: ret
= (long)va_arg(arg
, funp_t
); break;
36 #ifndef __SDCC_pdk14 // Lack of memory - see RFE # 613.
37 #ifndef __SDCC_pdk15 // TODO: Decide on support for casts between object and function pointers for pdk!
39 #if !((defined __SDCC_stm8) && defined(__SDCC_MODEL_LARGE)) // STM8 large model has sizeof(void *) < size of function pointers.
40 #if !defined(__SDCC_ds390) && !defined(__SDCC_mcs51) // DS390 and at least some MCS-51 memory models have sizeof(void *) > size of function pointers.
43 ASSERT (varargs(1, mydata
.f
) == (long)ptr
);
44 ASSERT (varargs(1, mydata
.f
) == (long)(void*)testBug
);
45 ASSERT (varargs(2, (funp_t
)mydata
.f
) == (long)mydata
.f
);
46 ASSERT (varargs(2, (void (*)(void))mydata
.f
) == (long)mydata
.f
);