From 384599ef2c7c6811a423fa86bfd83baf5677a8f1 Mon Sep 17 00:00:00 2001 From: yexo Date: Mon, 16 Mar 2009 17:30:49 +0000 Subject: [PATCH] (svn r15743) -Codechange: move the definitions of some fake squirrel types to their own file. --- projects/openttd_vs80.vcproj | 4 ++++ projects/openttd_vs90.vcproj | 4 ++++ source.list | 1 + src/ai/api/ai_types.hpp | 9 +-------- src/script/fake_squirrel_types.hpp | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 src/script/fake_squirrel_types.hpp diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index 386311ede5..caa5cfe1df 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -2267,6 +2267,10 @@ + + diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 980b6f67f0..4ed8aa9e84 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -2264,6 +2264,10 @@ + + diff --git a/source.list b/source.list index c9c8b0d46d..6f3489400c 100644 --- a/source.list +++ b/source.list @@ -518,6 +518,7 @@ table/unmovable_land.h table/water_land.h # Script +script/fake_squirrel_types.hpp script/script_info.cpp script/script_info.hpp script/script_scanner.cpp diff --git a/src/ai/api/ai_types.hpp b/src/ai/api/ai_types.hpp index 2ccd1d27d8..45db6b324f 100644 --- a/src/ai/api/ai_types.hpp +++ b/src/ai/api/ai_types.hpp @@ -7,6 +7,7 @@ #include "../../core/overflowsafe_type.hpp" #include "../../company_type.h" +#include "../../script/fake_squirrel_types.hpp" /* Define all types here, so we don't have to include the whole _type.h maze */ typedef uint BridgeType; //!< Internal name, not of any use for you. @@ -30,12 +31,4 @@ typedef uint AIErrorType; //!< The types of errors inside the NoAI framework. typedef BridgeType BridgeID; //!< The ID of a bridge. typedef uint16 SubsidyID; //!< The ID of a subsidy. -#ifndef _SQUIRREL_H_ -/* Life becomes easier when we can tell about a function it needs the VM, but - * without really including 'squirrel.h'. */ -typedef struct SQVM *HSQUIRRELVM; //!< Pointer to Squirrel Virtual Machine. -typedef int SQInteger; //!< Squirrel Integer. -typedef struct SQObject HSQOBJECT; //!< Squirrel Object (fake declare) -#endif - #endif /* AI_TYPES_HPP */ diff --git a/src/script/fake_squirrel_types.hpp b/src/script/fake_squirrel_types.hpp new file mode 100644 index 0000000000..ef25008f1f --- /dev/null +++ b/src/script/fake_squirrel_types.hpp @@ -0,0 +1,16 @@ +/* $Id$ */ + +/** @file fake_squirrel_types.hpp Provides definitions for some squirrel types to prevent including squirrel.h in header files.*/ + +#ifndef FAKE_SQUIRREL_TYPES_HPP +#define FAKE_SQUIRREL_TYPES_HPP + +#ifndef _SQUIRREL_H_ +/* Life becomes easier when we can tell about a function it needs the VM, but + * without really including 'squirrel.h'. */ +typedef struct SQVM *HSQUIRRELVM; //!< Pointer to Squirrel Virtual Machine. +typedef int SQInteger; //!< Squirrel Integer. +typedef struct SQObject HSQOBJECT; //!< Squirrel Object (fake declare) +#endif + +#endif /* FAKE_SQUIRREL_TYPES_HPP */