aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-09 04:38:09 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-09 04:38:09 +0000
commitb87b29ec2ae449686a745c257e577b7158d8d4aa (patch)
tree0aff65097b1b198ef5797e88064ef66785d339f1
parent4980afd9b5225e207742f0711b392e887619640e (diff)
Try to appease MSVC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118487 91177308-0d34-0410-b5e6-96231b3b80d8
-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();