mstorsjo created this revision.
mstorsjo added reviewers: hhb, compnerd, amccarth.
Herald added subscribers: JDevlieghere, abidh.
Herald added a project: LLDB.

These ifdefs contain code that isn't specific to MSVC but useful for any 
windows target, like MinGW.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D67893

Files:
  lldb/source/Core/IOHandler.cpp
  lldb/source/Host/common/UDPSocket.cpp
  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
  lldb/source/Utility/SelectHelper.cpp
  lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Index: lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
===================================================================
--- lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -31,7 +31,7 @@
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/FileSpec.h"
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 #include "lldb/Host/windows/windows.h"
 #include <objbase.h>
 #endif
@@ -46,7 +46,7 @@
 // Initialize and TearDown the plugin every time, so we get a brand new
 // AST every time so that modifications to the AST from each test don't
 // leak into the next test.
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     ::CoInitializeEx(nullptr, COINIT_MULTITHREADED);
 #endif
 
@@ -69,7 +69,7 @@
     HostInfo::Terminate();
     FileSystem::Terminate();
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     ::CoUninitialize();
 #endif
   }
Index: lldb/source/Utility/SelectHelper.cpp
===================================================================
--- lldb/source/Utility/SelectHelper.cpp
+++ lldb/source/Utility/SelectHelper.cpp
@@ -92,7 +92,7 @@
 
 lldb_private::Status SelectHelper::Select() {
   lldb_private::Status error;
-#ifdef _MSC_VER
+#ifdef _WIN32
   // On windows FD_SETSIZE limits the number of file descriptors, not their
   // numeric value.
   lldbassert(m_fd_map.size() <= FD_SETSIZE);
@@ -107,7 +107,7 @@
   for (auto &pair : m_fd_map) {
     pair.second.PrepareForSelect();
     const lldb::socket_t fd = pair.first;
-#if !defined(__APPLE__) && !defined(_MSC_VER)
+#if !defined(__APPLE__) && !defined(_WIN32)
     lldbassert(fd < static_cast<int>(FD_SETSIZE));
     if (fd >= static_cast<int>(FD_SETSIZE)) {
       error.SetErrorStringWithFormat("%i is too large for select()", fd);
Index: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
===================================================================
--- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
+++ lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
@@ -564,7 +564,7 @@
       select_helper.SetTimeout(*timeout);
 
     select_helper.FDSetRead(handle);
-#if defined(_MSC_VER)
+#if defined(_WIN32)
     // select() won't accept pipes on Windows.  The entire Windows codepath
     // needs to be converted over to using WaitForMultipleObjects and event
     // HANDLEs, but for now at least this will allow ::select() to not return
Index: lldb/source/Host/common/UDPSocket.cpp
===================================================================
--- lldb/source/Host/common/UDPSocket.cpp
+++ lldb/source/Host/common/UDPSocket.cpp
@@ -80,7 +80,7 @@
                           &service_info_list);
   if (err != 0) {
     error.SetErrorStringWithFormat(
-#if defined(_MSC_VER) && defined(UNICODE)
+#if defined(_WIN32) && defined(UNICODE)
         "getaddrinfo(%s, %s, &hints, &info) returned error %i (%S)",
 #else
         "getaddrinfo(%s, %s, &hints, &info) returned error %i (%s)",
Index: lldb/source/Core/IOHandler.cpp
===================================================================
--- lldb/source/Core/IOHandler.cpp
+++ lldb/source/Core/IOHandler.cpp
@@ -579,7 +579,7 @@
   else
 #endif
   {
-#ifdef _MSC_VER
+#ifdef _WIN32
     const char *prompt = GetPrompt();
     if (prompt) {
       // Back up over previous prompt using Windows API
@@ -594,7 +594,7 @@
     }
 #endif
     IOHandler::PrintAsync(stream, s, len);
-#ifdef _MSC_VER
+#ifdef _WIN32
     if (prompt)
       IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt,
                             strlen(prompt));
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D6... Martin Storsjö via Phabricator via lldb-commits

Reply via email to