forked from OSchip/llvm-project
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
This commit is contained in:
parent
119f307317
commit
909bb7a3f4
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue