Cleanup: Remove old SaveLoad workarounds for MS VS 2017. (#12355)

This commit is contained in:
Peter Nelson 2024-03-23 00:12:35 +00:00 committed by GitHub
parent e904122441
commit df2ee7b06c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 45 deletions

View File

@ -329,17 +329,7 @@ public:
class SlStationGoods : public DefaultSaveLoadHandler<SlStationGoods, BaseStation> {
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;
/**

View File

@ -634,17 +634,7 @@ static Money _cargo_feeder_share;
class SlVehicleCommon : public DefaultSaveLoadHandler<SlVehicleCommon, Vehicle> {
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<SlVehicleDisaster, Vehicle> {
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