[Lldb-commits] [lldb] r243174 - Some fixes to get LLDB compiling with MSVC 2015.
Zachary Turner
zturner at google.com
Fri Jul 24 15:32:22 PDT 2015
Author: zturner
Date: Fri Jul 24 17:32:22 2015
New Revision: 243174
URL: http://llvm.org/viewvc/llvm-project?rev=243174&view=rev
Log:
Some fixes to get LLDB compiling with MSVC 2015.
Modified:
lldb/trunk/include/lldb/Host/windows/win32.h
lldb/trunk/source/Host/windows/Windows.cpp
Modified: lldb/trunk/include/lldb/Host/windows/win32.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/win32.h?rev=243174&r1=243173&r2=243174&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/windows/win32.h (original)
+++ lldb/trunk/include/lldb/Host/windows/win32.h Fri Jul 24 17:32:22 2015
@@ -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,
#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_
Modified: lldb/trunk/source/Host/windows/Windows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Windows.cpp?rev=243174&r1=243173&r2=243174&view=diff
==============================================================================
--- lldb/trunk/source/Host/windows/Windows.cpp (original)
+++ lldb/trunk/source/Host/windows/Windows.cpp Fri Jul 24 17:32:22 2015
@@ -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,
va_end(argptr);
return r;
}
+#endif
#endif // _MSC_VER
More information about the lldb-commits
mailing list