7 #pragma disable_warning 85
9 long subchar(void *pa
, void *pb
)
11 return *((char *) pa
) - *((char *) pb
);
14 long subint(void *pa
, void *pb
)
16 return *((int *) pa
) - *((int *) pb
);
19 long sublong(void *pa
, void *pb
)
21 return *((long *) pa
) - *((long *) pb
);
24 long addlong(void *pa
, void *pb
)
26 return *((long *) pa
) + *((long *) pb
);
29 #define NULL ((void *) 0)
31 #if defined (__SDCC_MODEL_MEDIUM)
32 typedef long (*subfunc_t
)(void *pa
, void * __pdata pb
);
33 #elif defined (__SDCC_MODEL_LARGE)
34 typedef long (*subfunc_t
)(void *pa
, void * __xdata pb
);
35 #elif defined (__SDCC_MODEL_HUGE)
36 typedef long (*subfunc_t
)(void *pa
, void * __xdata pb
);
38 typedef long (*subfunc_t
)(void *pa
, void *pb
);
41 subfunc_t
dosub(subfunc_t f
)
43 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
48 else if (f
== sublong
)
59 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
60 ASSERT (dosub(subchar
) == subint
);
61 ASSERT (dosub(subint
) == sublong
);
62 ASSERT (dosub(sublong
) == subchar
);
63 ASSERT (dosub(addlong
) == NULL
);
64 ASSERT (dosub(NULL
) == addlong
);