diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 35d9b7e81a..8c5b962ead 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -329,17 +329,7 @@ public: class SlStationGoods : public DefaultSaveLoadHandler { public: -#if defined(_MSC_VER) && (_MSC_VER == 1915 || _MSC_VER == 1916) - /* This table access private members of other classes; they have this - * class as friend. For MSVC CL 19.15 and 19.16 this doesn't work for - * "inline static const", so we are forced to wrap the table in a - * function. CL 19.16 is the latest for VS2017. */ - inline static const SaveLoad description[] = {{}}; - SaveLoadTable GetDescription() const override { -#else - inline -#endif - static const SaveLoad description[] = { + inline static const SaveLoad description[] = { SLEG_CONDVAR("waiting_acceptance", _waiting_acceptance, SLE_UINT16, SL_MIN_VERSION, SLV_68), SLE_CONDVAR(GoodsEntry, status, SLE_UINT8, SLV_68, SL_MAX_VERSION), SLE_VAR(GoodsEntry, time_since_pickup, SLE_UINT8), @@ -363,10 +353,7 @@ public: SLEG_CONDSTRUCTLIST("flow", SlStationFlow, SLV_183, SL_MAX_VERSION), SLEG_CONDSTRUCTLIST("cargo", SlStationCargo, SLV_183, SL_MAX_VERSION), }; -#if defined(_MSC_VER) && (_MSC_VER == 1915 || _MSC_VER == 1916) - return description; - } -#endif + inline const static SaveLoadCompatTable compat_description = _station_goods_sl_compat; /** diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index 2ae6e6ed3f..4e42de3962 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -634,17 +634,7 @@ static Money _cargo_feeder_share; class SlVehicleCommon : public DefaultSaveLoadHandler { public: -#if defined(_MSC_VER) && (_MSC_VER == 1915 || _MSC_VER == 1916) - /* This table access private members of other classes; they have this - * class as friend. For MSVC CL 19.15 and 19.16 this doesn't work for - * "inline static const", so we are forced to wrap the table in a - * function. CL 19.16 is the latest for VS2017. */ - inline static const SaveLoad description[] = {{}}; - SaveLoadTable GetDescription() const override { -#else - inline -#endif - static const SaveLoad description[] = { + inline static const SaveLoad description[] = { SLE_VAR(Vehicle, subtype, SLE_UINT8), SLE_REF(Vehicle, next, REF_VEHICLE_OLD), @@ -773,10 +763,7 @@ public: SLE_CONDVAR(Vehicle, depot_unbunching_next_departure, SLE_UINT64, SLV_DEPOT_UNBUNCHING, SL_MAX_VERSION), SLE_CONDVAR(Vehicle, round_trip_time, SLE_INT32, SLV_DEPOT_UNBUNCHING, SL_MAX_VERSION), }; -#if defined(_MSC_VER) && (_MSC_VER == 1915 || _MSC_VER == 1916) - return description; - } -#endif + inline const static SaveLoadCompatTable compat_description = _vehicle_common_sl_compat; void Save(Vehicle *v) const override @@ -982,17 +969,7 @@ public: class SlVehicleDisaster : public DefaultSaveLoadHandler { public: -#if defined(_MSC_VER) && (_MSC_VER == 1915 || _MSC_VER == 1916) - /* This table access private members of other classes; they have this - * class as friend. For MSVC CL 19.15 and 19.16 this doesn't work for - * "inline static const", so we are forced to wrap the table in a - * function. CL 19.16 is the latest for VS2017. */ - inline static const SaveLoad description[] = {{}}; - SaveLoadTable GetDescription() const override { -#else - inline -#endif - static const SaveLoad description[] = { + inline static const SaveLoad description[] = { SLE_REF(Vehicle, next, REF_VEHICLE_OLD), SLE_VAR(Vehicle, subtype, SLE_UINT8), @@ -1026,10 +1003,7 @@ public: SLE_CONDVAR(DisasterVehicle, big_ufo_destroyer_target, SLE_UINT32, SLV_191, SL_MAX_VERSION), SLE_CONDVAR(DisasterVehicle, flags, SLE_UINT8, SLV_194, SL_MAX_VERSION), }; -#if defined(_MSC_VER) && (_MSC_VER == 1915 || _MSC_VER == 1916) - return description; - } -#endif + inline const static SaveLoadCompatTable compat_description = _vehicle_disaster_sl_compat; void Save(Vehicle *v) const override