s/LLVM_ON_WIN32/_WIN32/, lldb

LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in            
HandleLLVMOptions.cmake, which is where _WIN32 defined too.  Just use the        
default macro instead of a reinvented one.                                      
                                                                                
See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.  
No intended behavior change.

llvm-svn: 329697
This commit is contained in:
Nico Weber
2018-04-10 13:33:45 +00:00
parent fb64730005
commit b1cb0b7957
13 changed files with 19 additions and 21 deletions

View File

@@ -11,7 +11,7 @@
#define liblldb_Host_windows_PosixApi_h
#include "llvm/Support/Compiler.h"
#if !defined(LLVM_ON_WIN32)
#if !defined(_WIN32)
#error "windows/PosixApi.h being #included on non Windows system!"
#endif

View File

@@ -48,7 +48,7 @@
#include "lldb/Utility/StreamCallback.h"
#include "lldb/Utility/StreamString.h"
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif

View File

@@ -46,7 +46,7 @@
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif

View File

@@ -26,7 +26,7 @@
#include "lldb/Utility/UUID.h" // for UUID, operator!=, operator==
#include "lldb/lldb-defines.h" // for LLDB_INVALID_INDEX32
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif

View File

@@ -17,7 +17,7 @@
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StringList.h" // for StringList
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif

View File

@@ -100,7 +100,7 @@ int File::GetDescriptor() const {
// Don't open the file descriptor if we don't need to, just get it from the
// stream if we have one.
if (StreamIsValid()) {
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
return _fileno(m_stream);
#else
return fileno(m_stream);

View File

@@ -26,7 +26,7 @@
#if HAVE_SYS_EVENT_H
#include <sys/event.h>
#elif defined(LLVM_ON_WIN32)
#elif defined(_WIN32)
#include <winsock2.h>
#elif defined(__ANDROID__)
#include <sys/syscall.h>
@@ -34,14 +34,14 @@
#include <poll.h>
#endif
#ifdef LLVM_ON_WIN32
#ifdef _WIN32
#define POLL WSAPoll
#else
#define POLL poll
#endif
#if SIGNAL_POLLING_UNSUPPORTED
#ifdef LLVM_ON_WIN32
#ifdef _WIN32
typedef int sigset_t;
typedef int siginfo_t;
#endif
@@ -262,7 +262,7 @@ MainLoop::~MainLoop() {
MainLoop::ReadHandleUP MainLoop::RegisterReadObject(const IOObjectSP &object_sp,
const Callback &callback,
Status &error) {
#ifdef LLVM_ON_WIN32
#ifdef _WIN32
if (object_sp->GetFdType() != IOObject:: eFDTypeSocket) {
error.SetErrorString("MainLoop: non-socket types unsupported on Windows");
return nullptr;

View File

@@ -233,7 +233,7 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
// Add current working directory.
debug_file_search_paths.AppendIfUnique(FileSpec(".", true));
#ifndef LLVM_ON_WIN32
#ifndef _WIN32
#if defined(__NetBSD__)
// Add /usr/libdata/debug directory.
debug_file_search_paths.AppendIfUnique(
@@ -242,7 +242,7 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
// Add /usr/lib/debug directory.
debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true));
#endif
#endif // LLVM_ON_WIN32
#endif // _WIN32
std::string uuid_str;
const UUID &module_uuid = module_spec.GetUUID();

View File

@@ -26,11 +26,11 @@
#include <sys/socket.h>
#endif
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
#include <winsock2.h>
#endif
#ifdef LLVM_ON_WIN32
#ifdef _WIN32
#define CLOSE_SOCKET closesocket
typedef const char *set_socket_option_arg_type;
#else

View File

@@ -18,7 +18,7 @@
// Python is disabled in this build
#else
#include "llvm/Support/Compiler.h"
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
// If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We
// need to ensure this doesn't happen. At the same time, Python.h will also try
// to redefine a bunch of stuff that PosixApi.h defines. So define it all now

View File

@@ -17,7 +17,6 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h" // for Triple
#include "llvm/ADT/Twine.h" // for Twine
#include "llvm/Config/llvm-config.h" // for LLVM_ON_WIN32
#include "llvm/Support/ErrorOr.h" // for ErrorOr
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
@@ -38,7 +37,7 @@ using namespace lldb_private;
namespace {
static constexpr FileSpec::PathSyntax GetNativeSyntax() {
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
return FileSpec::ePathSyntaxWindows;
#else
return FileSpec::ePathSyntaxPosix;

View File

@@ -28,7 +28,7 @@
#include <utility> // for pair
#include <assert.h> // for assert
#if defined(LLVM_ON_WIN32)
#if defined(_WIN32)
#include <process.h> // for getpid
#else
#include <unistd.h>

View File

@@ -14,12 +14,11 @@
#include "llvm/ADT/STLExtras.h" // for any_of
#include "llvm/ADT/SmallVector.h" // for SmallVectorImpl
#include "llvm/Config/llvm-config.h" // for LLVM_ON_WIN32
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h" // for fs
#if !defined(LLVM_ON_WIN32)
#if !defined(_WIN32)
#include <pwd.h>
#endif
@@ -49,7 +48,7 @@ bool StandardTildeExpressionResolver::ResolvePartial(StringRef Expr,
assert(Expr.empty() || Expr[0] == '~');
Output.clear();
#if defined(LLVM_ON_WIN32) || defined(__ANDROID__)
#if defined(_WIN32) || defined(__ANDROID__)
return false;
#else
if (Expr.empty())