diff options
author | Colin Riley <colin@codeplay.com> | 2013-11-26 15:10:46 +0000 |
---|---|---|
committer | Colin Riley <colin@codeplay.com> | 2013-11-26 15:10:46 +0000 |
commit | 909bb7a3f42e7c57d9fad0798d4caac059ff5dd9 (patch) | |
tree | b4505966ef6d51f782ae12d6d5248070a447a3fa | |
parent | 119f3073173cf6ae02d632d21e3926fcdac853fe (diff) | |
download | bcm5719-llvm-909bb7a3f42e7c57d9fad0798d4caac059ff5dd9.tar.gz bcm5719-llvm-909bb7a3f42e7c57d9fad0798d4caac059ff5dd9.zip |
Fix MSVC build
Added _WIN32 guards to new platform features. Using correct SetErrorStringWithFormat within Host when LLDB_DISABLE_POSIX is defined. Also fixed an if defined block.
llvm-svn: 195766
-rw-r--r-- | lldb/source/Host/common/File.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Host/common/Host.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Target/Platform.cpp | 5 |
4 files changed, 19 insertions, 7 deletions
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp index 91fc8bd6b7b..bbd11858aab 100644 --- a/lldb/source/Host/common/File.cpp +++ b/lldb/source/Host/common/File.cpp @@ -237,8 +237,10 @@ File::Open (const char *path, uint32_t options, uint32_t permissions) { oflag |= O_RDONLY; +#ifndef _WIN32 if (options & eOpenoptionDontFollowSymlinks) oflag |= O_NOFOLLOW; +#endif } #ifndef _WIN32 diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index d812ae045e3..262776f6c71 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -1569,7 +1569,7 @@ Host::RunShellCommand (const char *command, return error; } -#if defined(__linux__) or defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) // The functions below implement process launching via posix_spawn() for Linux // and FreeBSD. @@ -1858,7 +1858,7 @@ Error Host::MakeDirectory (const char* path, uint32_t mode) { Error error; - error.SetErrorString("%s in not implemented on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s in not implemented on this host", __PRETTY_FUNCTION__); return error; } @@ -1866,7 +1866,7 @@ Error Host::GetFilePermissions (const char* path, uint32_t &file_permissions) { Error error; - error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__); return error; } @@ -1874,7 +1874,7 @@ Error Host::SetFilePermissions (const char* path, uint32_t file_permissions) { Error error; - error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__); return error; } @@ -1882,7 +1882,7 @@ Error Host::Symlink (const char *src, const char *dst) { Error error; - error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__); return error; } @@ -1890,7 +1890,7 @@ Error Host::Readlink (const char *path, char *buf, size_t buf_len) { Error error; - error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__); return error; } @@ -1898,7 +1898,7 @@ Error Host::Unlink (const char *path) { Error error; - error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__); + error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__); return error; } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index 1e9bf0df86d..7cc3a05304d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -1011,9 +1011,14 @@ GDBRemoteCommunicationServer::Handle_QSetWorkingDir (StringExtractorGDBRemote &p packet.GetHexByteString(path); if (m_is_platform) { +#ifdef _WIN32 + // Not implemented on Windows + return SendUnimplementedResponse("GDBRemoteCommunicationServer::Handle_QSetWorkingDir unimplemented"); +#else // If this packet is sent to a platform, then change the current working directory if (::chdir(path.c_str()) != 0) return SendErrorResponse(errno); +#endif } else { diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 1bf9f10855f..9c6501f3894 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -671,12 +671,17 @@ Platform::SetWorkingDirectory (const ConstString &path) { if (IsHost()) { +#ifdef _WIN32 + // Not implemented on Windows + return false; +#else if (path) { if (chdir(path.GetCString()) == 0) return true; } return false; +#endif } else { |