]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
(hopefully) fixed stoi/stof compile problems on vc2010
authorPerttu Ahola <celeron55@gmail.com>
Wed, 18 May 2011 19:05:31 +0000 (22:05 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Wed, 18 May 2011 19:05:31 +0000 (22:05 +0300)
src/utility.h

index 326ebf16125f002ffe95a63b19dab05925332648..28732a099f3a8cc77b6361530f4cde4ebe6d7d94 100644 (file)
@@ -800,16 +800,15 @@ 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());
 }
 
-inline s32 stoi(std::wstring s)
-{
-       return atoi(wide_to_narrow(s).c_str());
-}
-
 inline float stof(std::string s)
 {
        float f;
@@ -818,6 +817,13 @@ inline float stof(std::string s)
        return f;
 }
 
+#endif
+
+inline s32 stoi(std::wstring s)
+{
+       return atoi(wide_to_narrow(s).c_str());
+}
+
 inline std::string itos(s32 i)
 {
        std::ostringstream o;