diff options
author | darkvater <darkvater@openttd.org> | 2004-12-05 19:50:58 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-12-05 19:50:58 +0000 |
commit | 78b651c2c9569c82e4b030e6490db3223dad1c6f (patch) | |
tree | 8b602e39ff2ccba52cf28d42225ea7486165c6a5 | |
parent | 7c2448ecea6ec47f9df4928ad3f42668936835ee (diff) | |
download | openttd-78b651c2c9569c82e4b030e6490db3223dad1c6f.tar.xz |
(svn r957) -Fix: vehicle.c compiler problems for MSVC6 only! (Tron)
-rw-r--r-- | saveload.h | 3 | ||||
-rw-r--r-- | vehicle.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/saveload.h b/saveload.h index 72d470662..885d2b431 100644 --- a/saveload.h +++ b/saveload.h @@ -92,6 +92,9 @@ enum { }; #define SLE_VAR(t,i,c) 0 | (offsetof(t,i) & 0xF), offsetof(t,i) >> 4, c +#if MSC_VER == 1200 /* XXX workaround for MSVC6 */ +#define SLE_VAR2(t0,i0, t1, i1, c) 0 | ((offsetof(t0, i0) + offsetof(t1, i1)) & 0xF), (offsetof(t0, i0) + offsetof(t1, i1)) >> 4, c +#endif #define SLE_REF(t,i,c) 0x10 | (offsetof(t,i) & 0xF), offsetof(t,i) >> 4, c #define SLE_ARR(t,i,c,l) 0x20 | (offsetof(t,i) & 0xF), offsetof(t,i) >> 4, c, l #define SLE_CONDVAR(t,i,c,from,to) 0x40 | (offsetof(t,i) & 0xF), offsetof(t,i) >> 4, c, from, to @@ -1593,7 +1593,11 @@ const byte _common_veh_desc[] = { SLE_VAR(Vehicle,cur_order_index, SLE_UINT8), SLE_VAR(Vehicle,num_orders, SLE_UINT8), SLE_VAR(Vehicle,current_order, SLE_UINT8), /* XXX hack to avoid version bump */ + #if _MSC_VER != 1200 SLE_VAR(Vehicle,current_order.station, SLE_UINT8), + #else /* XXX workaround for MSVC6 */ + SLE_VAR2(Vehicle, current_order, Order, station, SLE_UINT8), + #endif SLE_REF(Vehicle,schedule_ptr, REF_SCHEDULE), SLE_VAR(Vehicle,age, SLE_UINT16), @@ -1737,7 +1741,11 @@ static const byte _disaster_desc[] = { SLE_VAR(Vehicle,z_height, SLE_UINT8), SLE_VAR(Vehicle,owner, SLE_UINT8), SLE_VAR(Vehicle,vehstatus, SLE_UINT8), + #if _MSC_VER != 1200 SLE_VAR(Vehicle,current_order.station, SLE_UINT8), + #else /* XXX workaround for MSVC6 */ + SLE_VAR2(Vehicle, current_order, Order, station, SLE_UINT8), + #endif SLE_VAR(Vehicle,cur_image, SLE_UINT16), SLE_VAR(Vehicle,age, SLE_UINT16), |