summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVirgile Bello <virgile.bello@gmail.com>2013-09-20 22:35:22 +0000
committerVirgile Bello <virgile.bello@gmail.com>2013-09-20 22:35:22 +0000
commit6957195ae500e5b69d04c60008069e7716200862 (patch)
tree9b7363fecc2e731f3278db27728ff92cd28d44bd
parent1fd7ec75fcae2966530830df4a8c6a983733f515 (diff)
downloadbcm5719-llvm-6957195ae500e5b69d04c60008069e7716200862.tar.gz
bcm5719-llvm-6957195ae500e5b69d04c60008069e7716200862.zip
Various small changes for build of LLDB on Visual Studio 2013 RC (MSVC12)
llvm-svn: 191116
-rw-r--r--lldb/include/lldb/Host/TimeValue.h2
-rw-r--r--lldb/include/lldb/Interpreter/OptionValueEnumeration.h2
-rw-r--r--lldb/include/lldb/lldb-defines.h5
-rw-r--r--lldb/include/lldb/lldb-types.h2
-rw-r--r--lldb/source/Host/common/FileSpec.cpp2
-rw-r--r--lldb/source/Host/common/TimeValue.cpp15
6 files changed, 27 insertions, 1 deletions
diff --git a/lldb/include/lldb/Host/TimeValue.h b/lldb/include/lldb/Host/TimeValue.h
index c136be77c13..ba230045307 100644
--- a/lldb/include/lldb/Host/TimeValue.h
+++ b/lldb/include/lldb/Host/TimeValue.h
@@ -12,6 +12,7 @@
// C Includes
#include <stdint.h>
+#ifndef _MSC_VER
#include <sys/time.h>
// BEGIN: MinGW work around
@@ -19,6 +20,7 @@
#include <pthread.h>
#endif
// END: MinGW work around
+#endif
// C++ Includes
// Other libraries and framework includes
diff --git a/lldb/include/lldb/Interpreter/OptionValueEnumeration.h b/lldb/include/lldb/Interpreter/OptionValueEnumeration.h
index 012eeb68ac0..68beddfce0d 100644
--- a/lldb/include/lldb/Interpreter/OptionValueEnumeration.h
+++ b/lldb/include/lldb/Interpreter/OptionValueEnumeration.h
@@ -34,7 +34,7 @@ public:
const char *description;
};
typedef UniqueCStringMap<EnumeratorInfo> EnumerationMap;
- typedef typename EnumerationMap::Entry EnumerationMapEntry;
+ typedef EnumerationMap::Entry EnumerationMapEntry;
OptionValueEnumeration (const OptionEnumValueElement *enumerators, enum_type value);
diff --git a/lldb/include/lldb/lldb-defines.h b/lldb/include/lldb/lldb-defines.h
index efce03f1bae..ab44391128d 100644
--- a/lldb/include/lldb/lldb-defines.h
+++ b/lldb/include/lldb/lldb-defines.h
@@ -114,6 +114,11 @@
#define MAX_PATH 260
#endif
+#ifdef _MSC_VER
+// ignore GCC function attributes
+#define __attribute__(X)
+#endif
+
#if defined(__cplusplus)
//----------------------------------------------------------------------
diff --git a/lldb/include/lldb/lldb-types.h b/lldb/include/lldb/lldb-types.h
index ec4408c7ce2..c7b3e7e6c3c 100644
--- a/lldb/include/lldb/lldb-types.h
+++ b/lldb/include/lldb/lldb-types.h
@@ -35,8 +35,10 @@
// things should be defined. Currently MacOSX is being assumed by default
// since that is what lldb was first developed for.
+#ifndef _MSC_VER
#include <stdbool.h>
#include <unistd.h>
+#endif
#ifdef _WIN32
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index 4b8037aef11..33de198072d 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -14,7 +14,9 @@
#include "lldb/Host/windows/windows.h"
#endif
#include <fcntl.h>
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <sys/stat.h>
#include <set>
#include <string.h>
diff --git a/lldb/source/Host/common/TimeValue.cpp b/lldb/source/Host/common/TimeValue.cpp
index 5debd9eade4..b471a3dd1f1 100644
--- a/lldb/source/Host/common/TimeValue.cpp
+++ b/lldb/source/Host/common/TimeValue.cpp
@@ -14,6 +14,11 @@
#include <stddef.h>
#include <time.h>
#include <cstring>
+
+#ifdef _MSC_VER
+#include "lldb/Host/windows/windows.h"
+#endif
+
// C++ Includes
// Other libraries and framework includes
// Project includes
@@ -119,10 +124,20 @@ TimeValue
TimeValue::Now()
{
uint32_t seconds, nanoseconds;
+#if _MSC_VER
+ SYSTEMTIME st;
+ GetSystemTime(&st);
+ nanoseconds = st.wMilliseconds * 1000000;
+ FILETIME ft;
+ SystemTimeToFileTime(&st, &ft);
+
+ seconds = ((((uint64_t)ft.dwHighDateTime) << 32 | ft.dwLowDateTime) / 10000000) - 11644473600ULL;
+#else
struct timeval tv;
gettimeofday(&tv, NULL);
seconds = tv.tv_sec;
nanoseconds = tv.tv_usec * NanoSecPerMicroSec;
+#endif
TimeValue now(seconds, nanoseconds);
return now;
}
OpenPOWER on IntegriCloud