Some fixes to get LLDB compiling with MSVC 2015.

llvm-svn: 243174
This commit is contained in:
Zachary Turner
2015-07-24 22:32:22 +00:00
parent 1bb48de1f9
commit fbf8dad8eb
2 changed files with 10 additions and 0 deletions

View File

@@ -63,7 +63,10 @@ char *dirname(char *path);
int strcasecmp(const char* s1, const char* s2);
int strncasecmp(const char* s1, const char* s2, size_t n);
#if _MSC_VER < 1900
int snprintf(char *buffer, size_t count, const char *format, ...);
#endif
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
@@ -77,11 +80,16 @@ int snprintf(char *buffer, size_t count, const char *format, ...);
#endif // _MSC_VER
// timespec
// MSVC 2015 and higher have timespec. Otherwise we need to define it ourselves.
#if defined(_MSC_VER) && _MSC_VER >= 1900
#include <time.h>
#else
struct timespec
{
time_t tv_sec;
long tv_nsec;
};
#endif
#endif // LLDB_lldb_win32_h_

View File

@@ -202,6 +202,7 @@ int usleep(uint32_t useconds)
return 0;
}
#if _MSC_VER < 1900
int snprintf(char *buffer, size_t count, const char *format, ...)
{
int old_errno = errno;
@@ -226,5 +227,6 @@ int snprintf(char *buffer, size_t count, const char *format, ...)
va_end(argptr);
return r;
}
#endif
#endif // _MSC_VER