mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r18557) -Fix: (most of) gcc errors when using lto caused by some structs having different definition in different object files
This commit is contained in:
parent
37c48a7727
commit
f708b9a80a
@ -21,8 +21,6 @@
|
||||
#include "../script/squirrel_helper.hpp"
|
||||
#include "../script/squirrel_class.hpp"
|
||||
|
||||
#define DEFINE_SCRIPT_FILES
|
||||
|
||||
#include "ai_config.hpp"
|
||||
#include "ai_storage.hpp"
|
||||
#include "ai_instance.hpp"
|
||||
@ -82,8 +80,6 @@
|
||||
#include "api/ai_waypoint.hpp.sq"
|
||||
#include "api/ai_waypointlist.hpp.sq"
|
||||
|
||||
#undef DEFINE_SCRIPT_FILES
|
||||
|
||||
#include "../fileio_func.h"
|
||||
|
||||
AIStorage::~AIStorage()
|
||||
|
@ -23,14 +23,10 @@ public:
|
||||
|
||||
/** Different constants related to CompanyID. */
|
||||
enum CompanyID {
|
||||
COMPANY_INVALID = -1, //!< An invalid company.
|
||||
|
||||
#ifdef DEFINE_SCRIPT_FILES
|
||||
COMPANY_FIRST = 0, //!< The first available company.
|
||||
COMPANY_LAST = ::MAX_COMPANIES, //!< The last available company.
|
||||
#endif /* DEFINE_SCRIPT_FILES */
|
||||
|
||||
COMPANY_SELF = 254, //!< Constant that gets resolved to the correct company index for your company.
|
||||
COMPANY_INVALID = -1, //!< An invalid company.
|
||||
};
|
||||
|
||||
/** Possible genders for company presidents. */
|
||||
|
@ -32,10 +32,10 @@ void SQAICompany_Register(Squirrel *engine)
|
||||
SQAICompany.PreRegister(engine);
|
||||
SQAICompany.AddConstructor<void (AICompany::*)(), 1>(engine, "x");
|
||||
|
||||
SQAICompany.DefSQConst(engine, AICompany::COMPANY_INVALID, "COMPANY_INVALID");
|
||||
SQAICompany.DefSQConst(engine, AICompany::COMPANY_FIRST, "COMPANY_FIRST");
|
||||
SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST, "COMPANY_LAST");
|
||||
SQAICompany.DefSQConst(engine, AICompany::COMPANY_SELF, "COMPANY_SELF");
|
||||
SQAICompany.DefSQConst(engine, AICompany::COMPANY_INVALID, "COMPANY_INVALID");
|
||||
SQAICompany.DefSQConst(engine, AICompany::GENDER_MALE, "GENDER_MALE");
|
||||
SQAICompany.DefSQConst(engine, AICompany::GENDER_FEMALE, "GENDER_FEMALE");
|
||||
SQAICompany.DefSQConst(engine, AICompany::GENDER_INVALID, "GENDER_INVALID");
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_map.cpp Implementation of AIMap. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_map.hpp"
|
||||
#include "../../tile_map.h"
|
||||
|
||||
|
@ -13,15 +13,14 @@
|
||||
#define AI_MAP_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "../../tile_type.h"
|
||||
|
||||
/**
|
||||
* Class that handles all map related functions.
|
||||
*/
|
||||
class AIMap : public AIObject {
|
||||
public:
|
||||
#ifdef DEFINE_SCRIPT_FILES
|
||||
static const int TILE_INVALID = (int)INVALID_TILE; //!< Invalid TileIndex.
|
||||
#endif /* DEFINE_SCRIPT_FILES */
|
||||
#ifdef DOXYGEN_SKIP
|
||||
const static TileIndex TILE_INVALID; //!< Invalid TileIndex.
|
||||
#endif /* DOXYGEN_SKIP */
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_road.cpp Implementation of AIRoad. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_map.hpp"
|
||||
#include "ai_station.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_station.cpp Implementation of AIStation. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_station.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
#include "ai_map.hpp"
|
||||
|
@ -80,10 +80,6 @@ public:
|
||||
VT_WATER, //!< Water type vehicle.
|
||||
VT_AIR, //!< Air type vehicle.
|
||||
VT_INVALID = 0xFF, //!< Invalid vehicle type.
|
||||
|
||||
#ifdef DEFINE_SCRIPT_FILES
|
||||
VEHICLE_INVALID = -1, //!< Invalid VehicleID.
|
||||
#endif /* DEFINE_SCRIPT_FILES */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -100,6 +96,8 @@ public:
|
||||
VS_INVALID = 0xFF, //!< An invalid vehicle state.
|
||||
};
|
||||
|
||||
static const int VEHICLE_INVALID = -1; //!< Invalid VehicleID.
|
||||
|
||||
/**
|
||||
* Checks whether the given vehicle is valid and owned by you.
|
||||
* @param vehicle_id The vehicle to check.
|
||||
|
@ -52,7 +52,6 @@ void SQAIVehicle_Register(Squirrel *engine)
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VT_WATER, "VT_WATER");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VT_AIR, "VT_AIR");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VT_INVALID, "VT_INVALID");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VEHICLE_INVALID, "VEHICLE_INVALID");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_RUNNING, "VS_RUNNING");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_STOPPED, "VS_STOPPED");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_IN_DEPOT, "VS_IN_DEPOT");
|
||||
@ -61,6 +60,8 @@ void SQAIVehicle_Register(Squirrel *engine)
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_CRASHED, "VS_CRASHED");
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_INVALID, "VS_INVALID");
|
||||
|
||||
SQAIVehicle.DefSQConst(engine, AIVehicle::VEHICLE_INVALID, "VEHICLE_INVALID");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_TOO_MANY_VEHICLES_IN_GAME, AIVehicle::ERR_VEHICLE_TOO_MANY);
|
||||
AIError::RegisterErrorMap(STR_ERROR_AIRCRAFT_NOT_AVAILABLE, AIVehicle::ERR_VEHICLE_NOT_AVAILABLE);
|
||||
AIError::RegisterErrorMap(STR_ERROR_ROAD_VEHICLE_NOT_AVAILABLE, AIVehicle::ERR_VEHICLE_NOT_AVAILABLE);
|
||||
|
Loading…
Reference in New Issue
Block a user