summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-31 19:57:21 +0000
committerrubidium <rubidium@openttd.org>2009-07-31 19:57:21 +0000
commit3c065342867c3ecd68d53a2eb3a20d9740200803 (patch)
treec1975cf98cc25559f8883ee6fb18c0e285f25e0b
parentc2ed8840123cc81f58b3db8d6341b22349b4ac78 (diff)
downloadopenttd-3c065342867c3ecd68d53a2eb3a20d9740200803.tar.xz
(svn r17006) -Fix (r17005): gcc compile failure
-rw-r--r--src/ai/api/ai_map.hpp4
-rw-r--r--src/ai/api/ai_map.hpp.sq4
-rw-r--r--src/ai/api/squirrel_export.awk2
3 files changed, 2 insertions, 8 deletions
diff --git a/src/ai/api/ai_map.hpp b/src/ai/api/ai_map.hpp
index 02514a214..e0d3cadc8 100644
--- a/src/ai/api/ai_map.hpp
+++ b/src/ai/api/ai_map.hpp
@@ -13,9 +13,7 @@
class AIMap : public AIObject {
public:
#ifdef DEFINE_SCRIPT_FILES
- enum MapType {
- TILE_INVALID = INVALID_TILE, //!< Invalid TileIndex.
- };
+ static const int TILE_INVALID = INVALID_TILE; //!< Invalid TileIndex.
#endif /* DEFINE_SCRIPT_FILES */
#ifdef DOXYGEN_SKIP
const static TileIndex TILE_INVALID; //!< Invalid TileIndex.
diff --git a/src/ai/api/ai_map.hpp.sq b/src/ai/api/ai_map.hpp.sq
index 043d02765..aa50247ec 100644
--- a/src/ai/api/ai_map.hpp.sq
+++ b/src/ai/api/ai_map.hpp.sq
@@ -4,10 +4,6 @@
#include "ai_map.hpp"
namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> AIMap::MapType GetParam(ForceType<AIMap::MapType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIMap::MapType)tmp; }
- template <> int Return<AIMap::MapType>(HSQUIRRELVM vm, AIMap::MapType res) { sq_pushinteger(vm, (int32)res); return 1; }
-
/* Allow AIMap to be used as Squirrel parameter */
template <> AIMap *GetParam(ForceType<AIMap *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; }
template <> AIMap &GetParam(ForceType<AIMap &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; }
diff --git a/src/ai/api/squirrel_export.awk b/src/ai/api/squirrel_export.awk
index eb829a510..37b1cdfa1 100644
--- a/src/ai/api/squirrel_export.awk
+++ b/src/ai/api/squirrel_export.awk
@@ -333,7 +333,7 @@ BEGIN {
}
# Add a const (non-enum) value
-/^[ ]*static const \w+ \w+ = \w+;$/ {
+/^[ ]*static const \w+ \w+ = \w+;/ {
const_size++
const_value[const_size] = $4
next