summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-12-05 19:50:58 +0000
committerdarkvater <darkvater@openttd.org>2004-12-05 19:50:58 +0000
commit54d3f2aff375becbe19ccfd32dfc806b7ef59532 (patch)
tree8b602e39ff2ccba52cf28d42225ea7486165c6a5
parentb8e83ca03fb8d652b8160419d9f1d07384f6f3e5 (diff)
downloadopenttd-54d3f2aff375becbe19ccfd32dfc806b7ef59532.tar.xz
(svn r957) -Fix: vehicle.c compiler problems for MSVC6 only! (Tron)
-rw-r--r--saveload.h3
-rw-r--r--vehicle.c8
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
diff --git a/vehicle.c b/vehicle.c
index 191268dae..003eca6c4 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -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),