debuggers.hg
changeset 19709:ae810b258394
blktap2: Fix build with gcc3. Cannot handle defining a function which
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>
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>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Thu May 28 11:01:00 2009 +0100 (2009-05-28) |
parents | 0e111bfd22d0 |
children | fe84a14aacd1 |
files | tools/blktap2/drivers/tapdisk-interface.c tools/blktap2/drivers/tapdisk.h |
line diff
1.1 --- a/tools/blktap2/drivers/tapdisk-interface.c Thu May 28 10:19:15 2009 +0100 1.2 +++ b/tools/blktap2/drivers/tapdisk-interface.c Thu May 28 11:01:00 2009 +0100 1.3 @@ -213,7 +213,7 @@ td_forward_request(td_request_t treq) 1.4 void 1.5 td_complete_request(td_request_t treq, int res) 1.6 { 1.7 - treq.cb(treq, res); 1.8 + ((td_callback_t)treq.cb)(treq, res); 1.9 } 1.10 1.11 void
2.1 --- a/tools/blktap2/drivers/tapdisk.h Thu May 28 10:19:15 2009 +0100 2.2 +++ b/tools/blktap2/drivers/tapdisk.h Thu May 28 11:01:00 2009 +0100 2.3 @@ -104,11 +104,6 @@ typedef struct td_request td_ 2.4 typedef struct td_driver_handle td_driver_t; 2.5 typedef struct td_image_handle td_image_t; 2.6 2.7 -/* 2.8 - * Prototype of the callback to activate as requests complete. 2.9 - */ 2.10 -typedef void (*td_callback_t)(td_request_t, int); 2.11 - 2.12 struct td_disk_id { 2.13 char *name; 2.14 int drivertype; 2.15 @@ -130,7 +125,7 @@ struct td_request { 2.16 2.17 td_image_t *image; 2.18 2.19 - td_callback_t cb; 2.20 + void * /*td_callback_t*/ cb; 2.21 void *cb_data; 2.22 2.23 uint64_t id; 2.24 @@ -139,6 +134,11 @@ struct td_request { 2.25 }; 2.26 2.27 /* 2.28 + * Prototype of the callback to activate as requests complete. 2.29 + */ 2.30 +typedef void (*td_callback_t)(td_request_t, int); 2.31 + 2.32 +/* 2.33 * Structure describing the interface to a virtual disk implementation. 2.34 * See note at the top of this file describing this interface. 2.35 */