2nd attempt to compile ldmd with MSVC.

This reverts the previous commits and reduces MSVC odditites to a single place.
This commit is contained in:
kai
2012-06-15 12:13:27 +02:00
parent 3eef7b7d55
commit 9824a3a1f8

View File

@@ -50,9 +50,6 @@
#include <cstdlib>
#include <numeric>
#include <vector>
#if defined(_MSC_VER)
#include <stdarg.h>
#endif
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/SystemUtils.h"
@@ -62,10 +59,6 @@
# include <unistd.h>
#endif
#if defined(_MSC_VER)
#define snprintf _snprintf
#endif
namespace ls = llvm::sys;
// We reuse DMD's response file parsing routine for maximum compatibilty - it
@@ -114,7 +107,11 @@ char* concat(const char* a, const char* b)
char* concat(const char* a, int b)
{
char bStr[14];
#if defined(_MSC_VER)
_snprintf_s(bStr, _countof(bStr), sizeof(bStr), "%d", b);
#else
snprintf(bStr, sizeof(bStr), "%d", b);
#endif
return concat(a, bStr);
}