]> granicus.if.org Git - clang/commitdiff
Try to appease MSVC
authorDouglas Gregor <dgregor@apple.com>
Tue, 9 Nov 2010 04:38:09 +0000 (04:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 9 Nov 2010 04:38:09 +0000 (04:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118487 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/DocumentXML.cpp
lib/Lex/PPMacroExpansion.cpp

index 75c15831737f789327a1d012231415b8427ab949..9ed10c8b4e89a620cd9e7f6a617f0c2559cfd3a9 100644 (file)
@@ -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;
index 9fe5ab4847bea408791914cfb0a5b81e91b49c82..c3bcab2af27b222f5bc7b38f58224ab050ea7ed6 100644 (file)
@@ -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();