summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-12-19 23:53:15 +0000
committersmatz <smatz@openttd.org>2009-12-19 23:53:15 +0000
commita608fbaf7ffb487444b2e029bb7677af8e172699 (patch)
tree85ac6e321cb114ded6373b6b03f2ac98eb5a9815
parent64478eb9600c9402c8e508ba912e973930b13de8 (diff)
downloadopenttd-a608fbaf7ffb487444b2e029bb7677af8e172699.tar.xz
(svn r18557) -Fix: (most of) gcc errors when using lto caused by some structs having different definition in different object files
-rw-r--r--src/ai/ai_instance.cpp4
-rw-r--r--src/ai/api/ai_company.hpp10
-rw-r--r--src/ai/api/ai_company.hpp.sq2
-rw-r--r--src/ai/api/ai_map.cpp1
-rw-r--r--src/ai/api/ai_map.hpp3
-rw-r--r--src/ai/api/ai_road.cpp1
-rw-r--r--src/ai/api/ai_station.cpp1
-rw-r--r--src/ai/api/ai_vehicle.hpp6
-rw-r--r--src/ai/api/ai_vehicle.hpp.sq3
9 files changed, 12 insertions, 19 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index 6ebaae46c..41b4c42c0 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -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()
diff --git a/src/ai/api/ai_company.hpp b/src/ai/api/ai_company.hpp
index 890956757..d32579ef8 100644
--- a/src/ai/api/ai_company.hpp
+++ b/src/ai/api/ai_company.hpp
@@ -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_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_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. */
diff --git a/src/ai/api/ai_company.hpp.sq b/src/ai/api/ai_company.hpp.sq
index 29fab8cb3..44937f024 100644
--- a/src/ai/api/ai_company.hpp.sq
+++ b/src/ai/api/ai_company.hpp.sq
@@ -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");
diff --git a/src/ai/api/ai_map.cpp b/src/ai/api/ai_map.cpp
index c9432fa26..d5728b9eb 100644
--- a/src/ai/api/ai_map.cpp
+++ b/src/ai/api/ai_map.cpp
@@ -9,6 +9,7 @@
/** @file ai_map.cpp Implementation of AIMap. */
+#include "../../stdafx.h"
#include "ai_map.hpp"
#include "../../tile_map.h"
diff --git a/src/ai/api/ai_map.hpp b/src/ai/api/ai_map.hpp
index b9d609f4e..59c102056 100644
--- a/src/ai/api/ai_map.hpp
+++ b/src/ai/api/ai_map.hpp
@@ -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 */
diff --git a/src/ai/api/ai_road.cpp b/src/ai/api/ai_road.cpp
index c43eb64ec..c221bbff0 100644
--- a/src/ai/api/ai_road.cpp
+++ b/src/ai/api/ai_road.cpp
@@ -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"
diff --git a/src/ai/api/ai_station.cpp b/src/ai/api/ai_station.cpp
index 670355dff..af9d184c8 100644
--- a/src/ai/api/ai_station.cpp
+++ b/src/ai/api/ai_station.cpp
@@ -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"
diff --git a/src/ai/api/ai_vehicle.hpp b/src/ai/api/ai_vehicle.hpp
index 3e050b570..4041287a7 100644
--- a/src/ai/api/ai_vehicle.hpp
+++ b/src/ai/api/ai_vehicle.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.
diff --git a/src/ai/api/ai_vehicle.hpp.sq b/src/ai/api/ai_vehicle.hpp.sq
index edd28b019..0e35a3afd 100644
--- a/src/ai/api/ai_vehicle.hpp.sq
+++ b/src/ai/api/ai_vehicle.hpp.sq
@@ -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);