aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-05-18 22:05:31 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-05-18 22:05:31 +0300
commitea3c653a8b6352b1df234e6a9663499e9a42bf90 (patch)
tree003f7ebfdd747fcb5982e8876b7ae08f7113665c
parentcdfb5345e980741f19c2ba02b06c24a763cd3e18 (diff)
downloadminetest-ea3c653a8b6352b1df234e6a9663499e9a42bf90.tar.gz
minetest-ea3c653a8b6352b1df234e6a9663499e9a42bf90.tar.bz2
minetest-ea3c653a8b6352b1df234e6a9663499e9a42bf90.zip
(hopefully) fixed stoi/stof compile problems on vc2010
-rw-r--r--src/utility.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/utility.h b/src/utility.h
index 326ebf161..28732a099 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -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;