diff --git a/include/lldb/Host/File.h b/include/lldb/Host/File.h
index 38b5d7e..596709f 100644
--- a/include/lldb/Host/File.h
+++ b/include/lldb/Host/File.h
@@ -21,6 +21,10 @@
 #include "lldb/Host/IOObject.h"
 #include "lldb/lldb-private.h"
 
+#if defined LLVM_ON_WIN32
+#include "lldb/Host/windows/win32.h"
+#endif
+
 namespace lldb_private
 {
 
diff --git a/include/lldb/Host/TimeValue.h b/include/lldb/Host/TimeValue.h
index f282fcb..fdc772f 100644
--- a/include/lldb/Host/TimeValue.h
+++ b/include/lldb/Host/TimeValue.h
@@ -12,9 +12,10 @@
 
 // C Includes
 #include <stdint.h>
-#ifndef _MSC_VER
-#include <sys/time.h>
 
+#include "llvm/Support/Compiler.h"
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
 #endif
 
 // C++ Includes
diff --git a/include/lldb/Utility/Iterable.h b/include/lldb/Utility/Iterable.h
index 628ba41..31976d1 100644
--- a/include/lldb/Utility/Iterable.h
+++ b/include/lldb/Utility/Iterable.h
@@ -16,6 +16,7 @@
 
 // Other libraries and framework includes
 // Project includes
+#include "lldb/lldb-defines.h"
 
 namespace lldb_private
 {
diff --git a/include/lldb/lldb-private-interfaces.h b/include/lldb/lldb-private-interfaces.h
index 5b4a732..005dea7 100644
--- a/include/lldb/lldb-private-interfaces.h
+++ b/include/lldb/lldb-private-interfaces.h
@@ -12,61 +12,93 @@
 
 #if defined(__cplusplus)
 
-#include "lldb/lldb-private.h"
+#include "lldb/lldb-forward.h"
+#include "lldb/lldb-types.h"
 
 #include <set>
 
-namespace lldb_private
-{
+namespace lldb_private {
 typedef lldb::ABISP (*ABICreateInstance)(const ArchSpec &arch);
-typedef Disassembler *(*DisassemblerCreateInstance)(const ArchSpec &arch, const char *flavor);
-typedef DynamicLoader *(*DynamicLoaderCreateInstance)(Process *process, bool force);
-typedef lldb::JITLoaderSP (*JITLoaderCreateInstance)(Process *process, bool force);
-typedef ObjectContainer *(*ObjectContainerCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
-                                                          lldb::offset_t data_offset, const FileSpec *file,
-                                                          lldb::offset_t offset, lldb::offset_t length);
-typedef size_t (*ObjectFileGetModuleSpecifications)(const FileSpec &file, lldb::DataBufferSP &data_sp,
-                                                    lldb::offset_t data_offset, lldb::offset_t file_offset,
-                                                    lldb::offset_t length, ModuleSpecList &module_specs);
-typedef ObjectFile *(*ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
-                                                lldb::offset_t data_offset, const FileSpec *file,
-                                                lldb::offset_t file_offset, lldb::offset_t length);
-typedef ObjectFile *(*ObjectFileCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
-                                                      const lldb::ProcessSP &process_sp, lldb::addr_t offset);
-typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, const FileSpec &outfile, Error &error);
+typedef Disassembler *(*DisassemblerCreateInstance)(const ArchSpec &arch,
+                                                    const char *flavor);
+typedef DynamicLoader *(*DynamicLoaderCreateInstance)(Process *process,
+                                                      bool force);
+typedef lldb::JITLoaderSP (*JITLoaderCreateInstance)(Process *process,
+                                                     bool force);
+typedef ObjectContainer *(*ObjectContainerCreateInstance)(
+    const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
+    lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t offset,
+    lldb::offset_t length);
+typedef size_t (*ObjectFileGetModuleSpecifications)(
+    const FileSpec &file, lldb::DataBufferSP &data_sp,
+    lldb::offset_t data_offset, lldb::offset_t file_offset,
+    lldb::offset_t length, ModuleSpecList &module_specs);
+typedef ObjectFile *(*ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp,
+                                                lldb::DataBufferSP &data_sp,
+                                                lldb::offset_t data_offset,
+                                                const FileSpec *file,
+                                                lldb::offset_t file_offset,
+                                                lldb::offset_t length);
+typedef ObjectFile *(*ObjectFileCreateMemoryInstance)(
+    const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
+    const lldb::ProcessSP &process_sp, lldb::addr_t offset);
+typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp,
+                                   const FileSpec &outfile, Error &error);
 typedef LogChannel *(*LogChannelCreateInstance)();
-typedef EmulateInstruction *(*EmulateInstructionCreateInstance)(const ArchSpec &arch, InstructionType inst_type);
-typedef OperatingSystem *(*OperatingSystemCreateInstance)(Process *process, bool force);
+typedef EmulateInstruction *(*EmulateInstructionCreateInstance)(
+    const ArchSpec &arch, InstructionType inst_type);
+typedef OperatingSystem *(*OperatingSystemCreateInstance)(Process *process,
+                                                          bool force);
 typedef Language *(*LanguageCreateInstance)(lldb::LanguageType language);
-typedef LanguageRuntime *(*LanguageRuntimeCreateInstance)(Process *process, lldb::LanguageType language);
-typedef lldb::CommandObjectSP (*LanguageRuntimeGetCommandObject)(CommandInterpreter &interpreter);
+typedef LanguageRuntime *(*LanguageRuntimeCreateInstance)(
+    Process *process, lldb::LanguageType language);
+typedef lldb::CommandObjectSP (*LanguageRuntimeGetCommandObject)(
+    CommandInterpreter &interpreter);
 typedef SystemRuntime *(*SystemRuntimeCreateInstance)(Process *process);
-typedef lldb::PlatformSP (*PlatformCreateInstance)(bool force, const ArchSpec *arch);
-typedef lldb::ProcessSP (*ProcessCreateInstance)(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
-                                                 const FileSpec *crash_file_path);
-typedef lldb::ScriptInterpreterSP (*ScriptInterpreterCreateInstance)(CommandInterpreter &interpreter);
+typedef lldb::PlatformSP (*PlatformCreateInstance)(bool force,
+                                                   const ArchSpec *arch);
+typedef lldb::ProcessSP (*ProcessCreateInstance)(
+    lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
+    const FileSpec *crash_file_path);
+typedef lldb::ScriptInterpreterSP (*ScriptInterpreterCreateInstance)(
+    CommandInterpreter &interpreter);
 typedef SymbolFile *(*SymbolFileCreateInstance)(ObjectFile *obj_file);
 typedef SymbolVendor *(*SymbolVendorCreateInstance)(
     const lldb::ModuleSP &module_sp,
-    lldb_private::Stream *feedback_strm); // Module can be NULL for default system symbol vendor
-typedef bool (*BreakpointHitCallback)(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id,
+    lldb_private::Stream
+        *feedback_strm); // Module can be NULL for default system symbol vendor
+typedef bool (*BreakpointHitCallback)(void *baton,
+                                      StoppointCallbackContext *context,
+                                      lldb::user_id_t break_id,
                                       lldb::user_id_t break_loc_id);
-typedef bool (*WatchpointHitCallback)(void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id);
-typedef void (*OptionValueChangedCallback)(void *baton, OptionValue *option_value);
-typedef bool (*ThreadPlanShouldStopHereCallback)(ThreadPlan *current_plan, Flags &flags,
-                                                 lldb::FrameComparison operation, void *baton);
-typedef lldb::ThreadPlanSP (*ThreadPlanStepFromHereCallback)(ThreadPlan *current_plan, Flags &flags,
-                                                             lldb::FrameComparison operation, void *baton);
+typedef bool (*WatchpointHitCallback)(void *baton,
+                                      StoppointCallbackContext *context,
+                                      lldb::user_id_t watch_id);
+typedef void (*OptionValueChangedCallback)(void *baton,
+                                           OptionValue *option_value);
+typedef bool (*ThreadPlanShouldStopHereCallback)(
+    ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
+    void *baton);
+typedef lldb::ThreadPlanSP (*ThreadPlanStepFromHereCallback)(
+    ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
+    void *baton);
 typedef UnwindAssembly *(*UnwindAssemblyCreateInstance)(const ArchSpec &arch);
-typedef lldb::MemoryHistorySP (*MemoryHistoryCreateInstance)(const lldb::ProcessSP &process_sp);
+typedef lldb::MemoryHistorySP (*MemoryHistoryCreateInstance)(
+    const lldb::ProcessSP &process_sp);
 typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType)();
-typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance)(const lldb::ProcessSP &process_sp);
-typedef lldb::TypeSystemSP (*TypeSystemCreateInstance)(lldb::LanguageType language, Module *module, Target *target);
-typedef lldb::REPLSP (*REPLCreateInstance)(Error &error, lldb::LanguageType language, Debugger *debugger,
-                                           Target *target, const char *repl_options);
-typedef void (*TypeSystemEnumerateSupportedLanguages)(std::set<lldb::LanguageType> &languages_for_types,
-                                                      std::set<lldb::LanguageType> &languages_for_expressions);
-typedef void (*REPLEnumerateSupportedLanguages)(std::set<lldb::LanguageType> &languages);
+typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance)(
+    const lldb::ProcessSP &process_sp);
+typedef lldb::TypeSystemSP (*TypeSystemCreateInstance)(
+    lldb::LanguageType language, Module *module, Target *target);
+typedef lldb::REPLSP (*REPLCreateInstance)(Error &error,
+                                           lldb::LanguageType language,
+                                           Debugger *debugger, Target *target,
+                                           const char *repl_options);
+typedef void (*TypeSystemEnumerateSupportedLanguages)(
+    std::set<lldb::LanguageType> &languages_for_types,
+    std::set<lldb::LanguageType> &languages_for_expressions);
+typedef void (*REPLEnumerateSupportedLanguages)(
+    std::set<lldb::LanguageType> &languages);
 typedef int (*ComparisonFunction)(const void *, const void *);
 typedef void (*DebuggerInitializeCallback)(Debugger &debugger);
 
diff --git a/include/lldb/lldb-private.h b/include/lldb/lldb-private.h
index 9786466..cd6936b 100644
--- a/include/lldb/lldb-private.h
+++ b/include/lldb/lldb-private.h
@@ -12,10 +12,6 @@
 
 #if defined(__cplusplus)
 
-#ifdef _WIN32
-#include "lldb/Host/windows/win32.h"
-#endif
-
 #include "lldb/lldb-private-defines.h"
 #include "lldb/lldb-private-enumerations.h"
 #include "lldb/lldb-private-interfaces.h"
diff --git a/source/Core/ConnectionSharedMemory.cpp b/source/Core/ConnectionSharedMemory.cpp
index 707644d..283a326 100644
--- a/source/Core/ConnectionSharedMemory.cpp
+++ b/source/Core/ConnectionSharedMemory.cpp
@@ -14,6 +14,7 @@
 // C Includes
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
+#include "lldb/Host/windows/win32.h"
 #else
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/source/Core/Error.cpp b/source/Core/Error.cpp
index a931023..b29ffb7 100644
--- a/source/Core/Error.cpp
+++ b/source/Core/Error.cpp
@@ -22,6 +22,7 @@
 // Project includes
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Host/windows/win32.h"
 
 using namespace lldb;
 using namespace lldb_private;
diff --git a/source/Core/Stream.cpp b/source/Core/Stream.cpp
index 15876d5..eb46b5c 100644
--- a/source/Core/Stream.cpp
+++ b/source/Core/Stream.cpp
@@ -8,6 +8,13 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Core/Stream.h"
+
+#include "llvm/Support/Compiler.h"
+
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "lldb/Host/Endian.h"
 #include <stddef.h>
 #include <stdio.h>
diff --git a/source/Host/common/NativeRegisterContext.cpp b/source/Host/common/NativeRegisterContext.cpp
index e67c079..2d60e65 100644
--- a/source/Host/common/NativeRegisterContext.cpp
+++ b/source/Host/common/NativeRegisterContext.cpp
@@ -9,6 +9,12 @@
 
 #include "lldb/Host/common/NativeRegisterContext.h"
 
+#include "llvm/Support/Compiler.h"
+
+#ifdef LLVM_ON_WIN32
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "lldb/Core/Log.h"
 #include "lldb/Core/RegisterValue.h"
 
diff --git a/source/Host/common/Terminal.cpp b/source/Host/common/Terminal.cpp
index 9f3abb7..3f83551 100644
--- a/source/Host/common/Terminal.cpp
+++ b/source/Host/common/Terminal.cpp
@@ -10,6 +10,12 @@
 #include "lldb/Host/Terminal.h"
 #include "llvm/ADT/STLExtras.h"
 
+#include "llvm/Support/Compiler.h"
+
+#ifdef LLVM_ON_WIN32
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include <fcntl.h>
 #include <signal.h>
 
diff --git a/source/Interpreter/OptionValueBoolean.cpp b/source/Interpreter/OptionValueBoolean.cpp
index dae1f4b..f46af9b 100644
--- a/source/Interpreter/OptionValueBoolean.cpp
+++ b/source/Interpreter/OptionValueBoolean.cpp
@@ -9,6 +9,12 @@
 
 #include "lldb/Interpreter/OptionValueBoolean.h"
 
+#include "llvm/Support/Compiler.h"
+
+#ifdef LLVM_ON_WIN32
+#include "lldb/Host/windows/win32.h"
+#endif
+
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
diff --git a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 984a9ec..0544129 100644
--- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -28,6 +28,10 @@ typedef struct ar_hdr
 #include <ar.h>
 #endif
 
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/Module.h"
diff --git a/source/Plugins/Process/Utility/ARMDefines.h b/source/Plugins/Process/Utility/ARMDefines.h
index 3f6dfde..58eb9d7 100644
--- a/source/Plugins/Process/Utility/ARMDefines.h
+++ b/source/Plugins/Process/Utility/ARMDefines.h
@@ -10,6 +10,9 @@
 #ifndef lldb_ARMDefines_h_
 #define lldb_ARMDefines_h_
 
+#include <assert.h>
+#include <stdint.h>
+
 // Common definitions for the ARM/Thumb Instruction Set Architecture.
 
 namespace lldb_private
diff --git a/source/Plugins/Process/Utility/RegisterContext_x86.h b/source/Plugins/Process/Utility/RegisterContext_x86.h
index 2929feb..eef59e6 100644
--- a/source/Plugins/Process/Utility/RegisterContext_x86.h
+++ b/source/Plugins/Process/Utility/RegisterContext_x86.h
@@ -10,6 +10,10 @@
 #ifndef liblldb_RegisterContext_x86_H_
 #define liblldb_RegisterContext_x86_H_
 
+#include "llvm/Support/Compiler.h"
+
+#include <stdint.h>
+
 //---------------------------------------------------------------------------
 // i386 ehframe, dwarf regnums
 //---------------------------------------------------------------------------
@@ -287,14 +291,17 @@ struct YMM
     YMMReg ymm[16]; // assembled from ymmh and xmm registers
 };
 
+LLVM_PACKED_START
 struct XSAVE_HDR
 {
     uint64_t xstate_bv; // OS enabled xstate mask to determine the extended states supported by the processor
     uint64_t reserved1[2];
     uint64_t reserved2[5];
-} __attribute__((packed));
+};
+LLVM_PACKED_END
 
 // x86 extensions to FXSAVE (i.e. for AVX processors)
+LLVM_PACKED_START
 struct XSAVE
 {
     FXSAVE i387;      // floating point registers typical in i387_fxsave_struct
@@ -302,7 +309,8 @@ struct XSAVE
     YMMHReg ymmh[16]; // High 16 bytes of each of 16 YMM registers (the low bytes are in FXSAVE.xmm for compatibility
                       // with SSE)
     // Slot any extensions to the register file here
-} __attribute__((packed, aligned(64)));
+} LLVM_ALIGNAS(64);
+LLVM_PACKED_END
 
 // Floating-point registers
 struct FPR
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index 60e5c6e..e816379 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -18,6 +18,10 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/Timer.h"
 
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "LogChannelDWARF.h"
 #include "SymbolFileDWARF.h"
 #include "DWARFDebugInfo.h"
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
index 547bd0c..238c493 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
@@ -9,6 +9,12 @@
 
 #include "DWARFDebugPubnames.h"
 
+#include "llvm/Support/Compiler.h"
+
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/Timer.h"
 
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index ca81962..e03d5be 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -10,7 +10,13 @@
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
+#include "llvm/Support/Compiler.h"
 // Project includes
+
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "SymbolFileDWARFDebugMap.h"
 
 #include "DWARFDebugAranges.h"
diff --git a/source/Target/PathMappingList.cpp b/source/Target/PathMappingList.cpp
index 2372c2f..34e844a 100644
--- a/source/Target/PathMappingList.cpp
+++ b/source/Target/PathMappingList.cpp
@@ -13,7 +13,13 @@
 #include <cstring>
 
 // Other libraries and framework includes
+#include "llvm/Support/Compiler.h"
+
 // Project includes
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Host/FileSpec.h"
diff --git a/source/Target/ProcessInfo.cpp b/source/Target/ProcessInfo.cpp
index 214db9e..1105004 100644
--- a/source/Target/ProcessInfo.cpp
+++ b/source/Target/ProcessInfo.cpp
@@ -11,6 +11,12 @@
 // C++ Includes
 #include <climits>
 
+#include "llvm/Support/Compiler.h"
+
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Target/ProcessInfo.h"
diff --git a/source/Utility/TimeSpecTimeout.h b/source/Utility/TimeSpecTimeout.h
index ec62237..3fa5a05 100644
--- a/source/Utility/TimeSpecTimeout.h
+++ b/source/Utility/TimeSpecTimeout.h
@@ -10,6 +10,13 @@
 #ifndef utility_TimeSpecTimeout_h_
 #define utility_TimeSpecTimeout_h_
 
+
+#include "llvm/Support/Compiler.h"
+
+#if defined(LLVM_ON_WIN32)
+#include "lldb/Host/windows/win32.h"
+#endif
+
 #include "lldb/Host/TimeValue.h"
 
 namespace lldb_private
