Let\'s say I have this function, which is part of some gui toolkit:
typedef struct _My_Struct My_Struct; /* struct ... */ void paint_handler( void* data ) {
I know the question is 3 years old but here I go, How about using a simple global enum to distinguish where the function is called from. then you can switch between what type to cast the void pointer to.