is passed a struct-by-value which is not yet fully defined. Thus
defining a request struct which contains a pointer to a function which
is passed-by-value an instance of that request structure is
impossible. We work around it by defining the function poiinter as
void* and then casting in one place.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
void
td_complete_request(td_request_t treq, int res)
{
- treq.cb(treq, res);
+ ((td_callback_t)treq.cb)(treq, res);
}
void
typedef struct td_driver_handle td_driver_t;
typedef struct td_image_handle td_image_t;
-/*
- * Prototype of the callback to activate as requests complete.
- */
-typedef void (*td_callback_t)(td_request_t, int);
-
struct td_disk_id {
char *name;
int drivertype;
td_image_t *image;
- td_callback_t cb;
+ void * /*td_callback_t*/ cb;
void *cb_data;
uint64_t id;
void *private;
};
+/*
+ * Prototype of the callback to activate as requests complete.
+ */
+typedef void (*td_callback_t)(td_request_t, int);
+
/*
* Structure describing the interface to a virtual disk implementation.
* See note at the top of this file describing this interface.