From 0659687bfbdf859414313aed33d9da7cef80efec Mon Sep 17 00:00:00 2001 From: Tobias Kortkamp Date: Mon, 25 Jan 2016 14:13:16 +0100 Subject: [PATCH] Some fixes for building on FreeBSD --- apps/essimporter/converter.hpp | 2 +- apps/essimporter/convertinventory.cpp | 1 + apps/openmw/crashcatcher.cpp | 2 +- apps/openmw/mwmechanics/spells.cpp | 2 +- apps/openmw/mwmechanics/spells.hpp | 2 +- apps/openmw/mwworld/projectilemanager.hpp | 1 + apps/openmw/mwworld/refdata.hpp | 1 + apps/openmw/mwworld/worldimp.cpp | 4 ++++ components/esm/spellstate.cpp | 6 +++--- components/esm/spellstate.hpp | 2 +- components/resource/bulletshape.cpp | 1 + components/sceneutil/lightcontroller.cpp | 1 + components/sceneutil/lightutil.cpp | 1 + 13 files changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/essimporter/converter.hpp b/apps/essimporter/converter.hpp index f364e166c..81b2bec14 100644 --- a/apps/essimporter/converter.hpp +++ b/apps/essimporter/converter.hpp @@ -121,7 +121,7 @@ public: { mContext->mPlayer.mObject.mCreatureStats.mLevel = npc.mNpdt52.mLevel; mContext->mPlayerBase = npc; - std::map empty; + std::map empty; // FIXME: player start spells and birthsign spells aren't listed here, // need to fix openmw to account for this for (std::vector::const_iterator it = npc.mSpells.mList.begin(); it != npc.mSpells.mList.end(); ++it) diff --git a/apps/essimporter/convertinventory.cpp b/apps/essimporter/convertinventory.cpp index f476fe1ee..0799c8d11 100644 --- a/apps/essimporter/convertinventory.cpp +++ b/apps/essimporter/convertinventory.cpp @@ -1,6 +1,7 @@ #include "convertinventory.hpp" #include +#include namespace ESSImport { diff --git a/apps/openmw/crashcatcher.cpp b/apps/openmw/crashcatcher.cpp index 0b4ff6304..cafd0e08a 100644 --- a/apps/openmw/crashcatcher.cpp +++ b/apps/openmw/crashcatcher.cpp @@ -24,7 +24,7 @@ #ifndef PR_SET_PTRACER #define PR_SET_PTRACER 0x59616d61 #endif -#elif defined (__APPLE__) +#elif defined (__APPLE__) || defined (__FreeBSD__) #include #endif diff --git a/apps/openmw/mwmechanics/spells.cpp b/apps/openmw/mwmechanics/spells.cpp index a88b6b263..2f87d0446 100644 --- a/apps/openmw/mwmechanics/spells.cpp +++ b/apps/openmw/mwmechanics/spells.cpp @@ -44,7 +44,7 @@ namespace MWMechanics { if (mSpells.find (spell)==mSpells.end()) { - std::map random; + std::map random; // Determine the random magnitudes (unless this is a castable spell, in which case // they will be determined when the spell is cast) diff --git a/apps/openmw/mwmechanics/spells.hpp b/apps/openmw/mwmechanics/spells.hpp index 1b1993d5e..a46988c4c 100644 --- a/apps/openmw/mwmechanics/spells.hpp +++ b/apps/openmw/mwmechanics/spells.hpp @@ -33,7 +33,7 @@ namespace MWMechanics typedef const ESM::Spell* SpellKey; - typedef std::map > TContainer; // ID, + typedef std::map > TContainer; // ID, typedef TContainer::const_iterator TIterator; struct CorprusStats diff --git a/apps/openmw/mwworld/projectilemanager.hpp b/apps/openmw/mwworld/projectilemanager.hpp index 74d4c1dc5..02ac6cb55 100644 --- a/apps/openmw/mwworld/projectilemanager.hpp +++ b/apps/openmw/mwworld/projectilemanager.hpp @@ -3,6 +3,7 @@ #include +#include #include #include diff --git a/apps/openmw/mwworld/refdata.hpp b/apps/openmw/mwworld/refdata.hpp index 28d2dad4c..d87ffdb70 100644 --- a/apps/openmw/mwworld/refdata.hpp +++ b/apps/openmw/mwworld/refdata.hpp @@ -5,6 +5,7 @@ #include "../mwscript/locals.hpp" +#include #include namespace SceneUtil diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index afb5be9d3..37743bceb 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -108,7 +108,11 @@ namespace MWWorld } private: +#ifdef HAVE_UNORDERED_MAP + typedef std::unordered_map LoadersContainer; +#else typedef std::tr1::unordered_map LoadersContainer; +#endif LoadersContainer mLoaders; }; diff --git a/components/esm/spellstate.cpp b/components/esm/spellstate.cpp index 3ed3329b4..8845842e9 100644 --- a/components/esm/spellstate.cpp +++ b/components/esm/spellstate.cpp @@ -12,7 +12,7 @@ namespace ESM { std::string id = esm.getHString(); - std::map random; + std::map random; while (esm.isNextSub("INDX")) { int index; @@ -73,8 +73,8 @@ namespace ESM { esm.writeHNString("SPEL", it->first); - const std::map& random = it->second; - for (std::map::const_iterator rIt = random.begin(); rIt != random.end(); ++rIt) + const std::map& random = it->second; + for (std::map::const_iterator rIt = random.begin(); rIt != random.end(); ++rIt) { esm.writeHNT("INDX", rIt->first); esm.writeHNT("RAND", rIt->second); diff --git a/components/esm/spellstate.hpp b/components/esm/spellstate.hpp index 028e6a387..503c3aea9 100644 --- a/components/esm/spellstate.hpp +++ b/components/esm/spellstate.hpp @@ -28,7 +28,7 @@ namespace ESM float mMagnitude; }; - typedef std::map > TContainer; + typedef std::map > TContainer; TContainer mSpells; std::map > mPermanentSpellEffects; diff --git a/components/resource/bulletshape.cpp b/components/resource/bulletshape.cpp index 968dbe6c6..0cbc63a22 100644 --- a/components/resource/bulletshape.cpp +++ b/components/resource/bulletshape.cpp @@ -1,6 +1,7 @@ #include "bulletshape.hpp" #include +#include #include #include diff --git a/components/sceneutil/lightcontroller.cpp b/components/sceneutil/lightcontroller.cpp index e3ea93843..47575e2e6 100644 --- a/components/sceneutil/lightcontroller.cpp +++ b/components/sceneutil/lightcontroller.cpp @@ -2,6 +2,7 @@ #include +#include #include #include diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 6499c54b1..979d41181 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -1,5 +1,6 @@ #include "lightutil.hpp" +#include #include #include #include