(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:
smatz 2009-12-19 23:53:15 +00:00
parent 64478eb960
commit a608fbaf7f
9 changed files with 12 additions and 19 deletions

View File

@ -21,8 +21,6 @@
#include "../script/squirrel_helper.hpp" #include "../script/squirrel_helper.hpp"
#include "../script/squirrel_class.hpp" #include "../script/squirrel_class.hpp"
#define DEFINE_SCRIPT_FILES
#include "ai_config.hpp" #include "ai_config.hpp"
#include "ai_storage.hpp" #include "ai_storage.hpp"
#include "ai_instance.hpp" #include "ai_instance.hpp"
@ -82,8 +80,6 @@
#include "api/ai_waypoint.hpp.sq" #include "api/ai_waypoint.hpp.sq"
#include "api/ai_waypointlist.hpp.sq" #include "api/ai_waypointlist.hpp.sq"
#undef DEFINE_SCRIPT_FILES
#include "../fileio_func.h" #include "../fileio_func.h"
AIStorage::~AIStorage() AIStorage::~AIStorage()

View File

@ -23,14 +23,10 @@ public:
/** Different constants related to CompanyID. */ /** Different constants related to CompanyID. */
enum CompanyID { enum CompanyID {
COMPANY_INVALID = -1, //!< An invalid company. COMPANY_FIRST = 0, //!< The first available company.
#ifdef DEFINE_SCRIPT_FILES
COMPANY_FIRST = 0, //!< The first available company.
COMPANY_LAST = ::MAX_COMPANIES, //!< The last 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.
COMPANY_SELF = 254, //!< Constant that gets resolved to the correct company index for your company.
}; };
/** Possible genders for company presidents. */ /** Possible genders for company presidents. */

View File

@ -32,10 +32,10 @@ void SQAICompany_Register(Squirrel *engine)
SQAICompany.PreRegister(engine); SQAICompany.PreRegister(engine);
SQAICompany.AddConstructor<void (AICompany::*)(), 1>(engine, "x"); 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_FIRST, "COMPANY_FIRST");
SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST, "COMPANY_LAST"); SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST, "COMPANY_LAST");
SQAICompany.DefSQConst(engine, AICompany::COMPANY_SELF, "COMPANY_SELF"); 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_MALE, "GENDER_MALE");
SQAICompany.DefSQConst(engine, AICompany::GENDER_FEMALE, "GENDER_FEMALE"); SQAICompany.DefSQConst(engine, AICompany::GENDER_FEMALE, "GENDER_FEMALE");
SQAICompany.DefSQConst(engine, AICompany::GENDER_INVALID, "GENDER_INVALID"); SQAICompany.DefSQConst(engine, AICompany::GENDER_INVALID, "GENDER_INVALID");

View File

@ -9,6 +9,7 @@
/** @file ai_map.cpp Implementation of AIMap. */ /** @file ai_map.cpp Implementation of AIMap. */
#include "../../stdafx.h"
#include "ai_map.hpp" #include "ai_map.hpp"
#include "../../tile_map.h" #include "../../tile_map.h"

View File

@ -13,15 +13,14 @@
#define AI_MAP_HPP #define AI_MAP_HPP
#include "ai_object.hpp" #include "ai_object.hpp"
#include "../../tile_type.h"
/** /**
* Class that handles all map related functions. * Class that handles all map related functions.
*/ */
class AIMap : public AIObject { class AIMap : public AIObject {
public: public:
#ifdef DEFINE_SCRIPT_FILES
static const int TILE_INVALID = (int)INVALID_TILE; //!< Invalid TileIndex. static const int TILE_INVALID = (int)INVALID_TILE; //!< Invalid TileIndex.
#endif /* DEFINE_SCRIPT_FILES */
#ifdef DOXYGEN_SKIP #ifdef DOXYGEN_SKIP
const static TileIndex TILE_INVALID; //!< Invalid TileIndex. const static TileIndex TILE_INVALID; //!< Invalid TileIndex.
#endif /* DOXYGEN_SKIP */ #endif /* DOXYGEN_SKIP */

View File

@ -9,6 +9,7 @@
/** @file ai_road.cpp Implementation of AIRoad. */ /** @file ai_road.cpp Implementation of AIRoad. */
#include "../../stdafx.h"
#include "ai_map.hpp" #include "ai_map.hpp"
#include "ai_station.hpp" #include "ai_station.hpp"
#include "ai_cargo.hpp" #include "ai_cargo.hpp"

View File

@ -9,6 +9,7 @@
/** @file ai_station.cpp Implementation of AIStation. */ /** @file ai_station.cpp Implementation of AIStation. */
#include "../../stdafx.h"
#include "ai_station.hpp" #include "ai_station.hpp"
#include "ai_cargo.hpp" #include "ai_cargo.hpp"
#include "ai_map.hpp" #include "ai_map.hpp"

View File

@ -80,10 +80,6 @@ public:
VT_WATER, //!< Water type vehicle. VT_WATER, //!< Water type vehicle.
VT_AIR, //!< Air type vehicle. VT_AIR, //!< Air type vehicle.
VT_INVALID = 0xFF, //!< Invalid vehicle type. 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. 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. * Checks whether the given vehicle is valid and owned by you.
* @param vehicle_id The vehicle to check. * @param vehicle_id The vehicle to check.

View File

@ -52,7 +52,6 @@ void SQAIVehicle_Register(Squirrel *engine)
SQAIVehicle.DefSQConst(engine, AIVehicle::VT_WATER, "VT_WATER"); SQAIVehicle.DefSQConst(engine, AIVehicle::VT_WATER, "VT_WATER");
SQAIVehicle.DefSQConst(engine, AIVehicle::VT_AIR, "VT_AIR"); SQAIVehicle.DefSQConst(engine, AIVehicle::VT_AIR, "VT_AIR");
SQAIVehicle.DefSQConst(engine, AIVehicle::VT_INVALID, "VT_INVALID"); 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_RUNNING, "VS_RUNNING");
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_STOPPED, "VS_STOPPED"); SQAIVehicle.DefSQConst(engine, AIVehicle::VS_STOPPED, "VS_STOPPED");
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_IN_DEPOT, "VS_IN_DEPOT"); 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_CRASHED, "VS_CRASHED");
SQAIVehicle.DefSQConst(engine, AIVehicle::VS_INVALID, "VS_INVALID"); 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_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_AIRCRAFT_NOT_AVAILABLE, AIVehicle::ERR_VEHICLE_NOT_AVAILABLE);
AIError::RegisterErrorMap(STR_ERROR_ROAD_VEHICLE_NOT_AVAILABLE, AIVehicle::ERR_VEHICLE_NOT_AVAILABLE); AIError::RegisterErrorMap(STR_ERROR_ROAD_VEHICLE_NOT_AVAILABLE, AIVehicle::ERR_VEHICLE_NOT_AVAILABLE);