]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/utility.h
All textures are are now searched first from the directory specified by the texture_p...
[dragonfireclient.git] / src / utility.h
index 326ebf16125f002ffe95a63b19dab05925332648..cc8891a0797c1345d0325460c8a4821c373528c9 100644 (file)
@@ -800,6 +800,10 @@ inline s32 stoi(const std::string &s, s32 min, s32 max)
        return i;
 }
 
+
+// MSVC2010 includes it's own versions of these
+#if !defined(_MSC_VER) || _MSC_VER < 1600
+
 inline s32 stoi(std::string s)
 {
        return atoi(s.c_str());
@@ -818,6 +822,8 @@ inline float stof(std::string s)
        return f;
 }
 
+#endif
+
 inline std::string itos(s32 i)
 {
        std::ostringstream o;
@@ -1760,12 +1766,12 @@ class UniqueQueue
        core::list<Value> m_list;
 };
 
-#if 0
+#if 1
 template<typename Key, typename Value>
-class MutexedCache
+class MutexedMap
 {
 public:
-       MutexedCache()
+       MutexedMap()
        {
                m_mutex.Init();
                assert(m_mutex.IsInitialized());
@@ -1787,8 +1793,10 @@ class MutexedCache
 
                if(n == NULL)
                        return false;
-
-               *result = n->getValue();
+               
+               if(result != NULL)
+                       *result = n->getValue();
+                       
                return true;
        }