diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2011-07-25 17:24:54 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2011-07-25 17:24:54 +0000 |
commit | 796f925175eda4e0b208e1206accba2281efa39f (patch) | |
tree | 636b21e3dae78619baabf2167e6915891201dc12 | |
parent | cc866d5d2df281de969004b6f37486f57f0a84f9 (diff) |
Fixes VS support for llvmc mcc16 llvmc example.
Patch by arrowdodger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135918 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/llvmc/examples/mcc16/Hooks.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/llvmc/examples/mcc16/Hooks.cpp b/tools/llvmc/examples/mcc16/Hooks.cpp index 95158efeec..bbb8438bc3 100644 --- a/tools/llvmc/examples/mcc16/Hooks.cpp +++ b/tools/llvmc/examples/mcc16/Hooks.cpp @@ -3,9 +3,10 @@ #include "llvm/Support/raw_ostream.h" #include <string> +#include <locale> namespace llvmc { - extern char *ProgramName; + extern const char *ProgramName; namespace autogenerated { extern llvm::cl::opt<std::string> Parameter_p; @@ -31,6 +32,7 @@ namespace hooks { // It is __partname format in lower case. std::string GetLowerCasePartDefine(void) { + std::locale loc; std::string Partname; if (autogenerated::Parameter_p.empty()) { Partname = "16f1xxx"; @@ -40,7 +42,7 @@ GetLowerCasePartDefine(void) { std::string LowerCase; for (unsigned i = 0; i < Partname.size(); i++) { - LowerCase.push_back(std::tolower(Partname[i])); + LowerCase.push_back(std::tolower(Partname[i], loc)); } return "__" + LowerCase; @@ -48,6 +50,7 @@ GetLowerCasePartDefine(void) { std::string GetUpperCasePartDefine(void) { + std::locale loc; std::string Partname; if (autogenerated::Parameter_p.empty()) { Partname = "16f1xxx"; @@ -57,7 +60,7 @@ GetUpperCasePartDefine(void) { std::string UpperCase; for (unsigned i = 0; i < Partname.size(); i++) { - UpperCase.push_back(std::toupper(Partname[i])); + UpperCase.push_back(std::toupper(Partname[i], loc)); } return "__" + UpperCase; |