[Lldb-commits] [lldb] r191116 - Various small changes for build of LLDB on Visual Studio 2013 RC (MSVC12)

Virgile Bello virgile.bello at gmail.com
Fri Sep 20 15:35:23 PDT 2013


Author: xen2
Date: Fri Sep 20 17:35:22 2013
New Revision: 191116

URL: http://llvm.org/viewvc/llvm-project?rev=191116&view=rev
Log:
Various small changes for build of LLDB on Visual Studio 2013 RC (MSVC12)

Modified:
    lldb/trunk/include/lldb/Host/TimeValue.h
    lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
    lldb/trunk/include/lldb/lldb-defines.h
    lldb/trunk/include/lldb/lldb-types.h
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Host/common/TimeValue.cpp

Modified: lldb/trunk/include/lldb/Host/TimeValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/TimeValue.h?rev=191116&r1=191115&r2=191116&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/TimeValue.h (original)
+++ lldb/trunk/include/lldb/Host/TimeValue.h Fri Sep 20 17:35:22 2013
@@ -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

Modified: lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h?rev=191116&r1=191115&r2=191116&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h Fri Sep 20 17:35:22 2013
@@ -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);
     

Modified: lldb/trunk/include/lldb/lldb-defines.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-defines.h?rev=191116&r1=191115&r2=191116&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-defines.h (original)
+++ lldb/trunk/include/lldb/lldb-defines.h Fri Sep 20 17:35:22 2013
@@ -114,6 +114,11 @@
 #define MAX_PATH 260
 #endif
 
+#ifdef _MSC_VER
+// ignore GCC function attributes
+#define __attribute__(X)
+#endif
+
 #if defined(__cplusplus)
 
 //----------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/lldb-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-types.h?rev=191116&r1=191115&r2=191116&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-types.h (original)
+++ lldb/trunk/include/lldb/lldb-types.h Fri Sep 20 17:35:22 2013
@@ -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
 

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=191116&r1=191115&r2=191116&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri Sep 20 17:35:22 2013
@@ -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>

Modified: lldb/trunk/source/Host/common/TimeValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TimeValue.cpp?rev=191116&r1=191115&r2=191116&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/TimeValue.cpp (original)
+++ lldb/trunk/source/Host/common/TimeValue.cpp Fri Sep 20 17:35:22 2013
@@ -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;
 }





More information about the lldb-commits mailing list