From 4619739b35930627d83fc1e09f5e23e6b0209b3d Mon Sep 17 00:00:00 2001 From: zilpin Date: Mon, 18 Jul 2011 16:45:00 -0400 Subject: [PATCH] -workaround compile time error with a C style string hack. --- tools/supported/tiletypes.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/supported/tiletypes.cpp b/tools/supported/tiletypes.cpp index 8d8fd625a..7b031f34c 100644 --- a/tools/supported/tiletypes.cpp +++ b/tools/supported/tiletypes.cpp @@ -13,14 +13,23 @@ using namespace std; #include #include +//zilpin: These two functions were giving me compile errors in VS2008, so I cheated with the C style loop below, just to get it to build. +//Original code is commented out. void tolower(std::string &str) { - std::transform(str.begin(), str.end(), str.begin(), std::bind2nd(std::ptr_fun(&std::tolower), std::locale(""))); + //The C++ way... + //std::transform(str.begin(), str.end(), str.begin(), std::bind2nd(std::ptr_fun(&std::tolower ), std::locale(""))); + + //The C way... + for(char *c=(char *)str.c_str(); *c; ++c) + *c = tolower(*c); } void toupper(std::string &str) { - std::transform(str.begin(), str.end(), str.begin(), std::bind2nd(std::ptr_fun(&std::toupper), std::locale(""))); + //std::transform(str.begin(), str.end(), str.begin(), std::bind2nd(std::ptr_fun(&std::toupper), std::locale(""))); + for(char *c=(char *)str.c_str(); *c; ++c) + *c = toupper(*c); } int toint(const std::string &str, int failValue = 0)