Well C doesn't have closures so `.cdecl` cannot support it either. Usually a `void* env` parameter is used in C so that you can pass user data to callbacks. But in this library's `event.h` it's declared as: typedef void (*lv_event_cb_t)(lv_event_t * e); /********************** * GLOBAL PROTOTYPES **********************/ void _lv_event_push(lv_event_t * e); void _lv_event_pop(lv_event_t * e); lv_res_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess); void lv_event_add(lv_event_list_t * list, lv_event_cb_t cb, lv_event_code_t filter, void * user_data); Run
Even though `lv_event_add` has this `void* user_data` it is absent in the declaration of `lv_event_cb_t`. You should aks on the project's issue tracker of why that is, looks like a big design mistake to me but what do I know.