aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Frontend/DocumentXML.cpp4
-rw-r--r--lib/Lex/PPMacroExpansion.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Frontend/DocumentXML.cpp b/lib/Frontend/DocumentXML.cpp
index 75c1583173..9ed10c8b4e 100644
--- a/lib/Frontend/DocumentXML.cpp
+++ b/lib/Frontend/DocumentXML.cpp
@@ -105,7 +105,11 @@ std::string DocumentXML::escapeString(const char* pStr,
if (isprint(C))
value += C;
else {
+#ifdef LLVM_ON_WIN32
+ sprintf(buffer, "\\%03o", C);
+#else
snprintf(buffer, sizeof(buffer), "\\%03o", C);
+#endif
value += buffer;
}
break;
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp
index 9fe5ab4847..c3bcab2af2 100644
--- a/lib/Lex/PPMacroExpansion.cpp
+++ b/lib/Lex/PPMacroExpansion.cpp
@@ -498,8 +498,13 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc,
};
char TmpBuffer[32];
+#ifdef LLVM_ON_WIN32
+ sprintf(TmpBuffer, "\"%s %2d %4d\"", Months[TM->tm_mon], TM->tm_mday,
+ TM->tm_year+1900);
+#else
snprintf(TmpBuffer, sizeof(TmpBuffer), "\"%s %2d %4d\"", Months[TM->tm_mon], TM->tm_mday,
TM->tm_year+1900);
+#endif
Token TmpTok;
TmpTok.startToken();