diff options
| author | Zachary Turner <zturner@google.com> | 2015-02-25 18:42:47 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-02-25 18:42:47 +0000 |
| commit | 171d943ac53788d5a41e35927d71dca30f878519 (patch) | |
| tree | 70e7d7eb438519e1dff9203cc51116e335215dac | |
| parent | f42e83cf722b71d82830e038143e3266a1b24a60 (diff) | |
| download | bcm5719-llvm-171d943ac53788d5a41e35927d71dca30f878519.tar.gz bcm5719-llvm-171d943ac53788d5a41e35927d71dca30f878519.zip | |
Fix warnings found with clang-cl.
Earlier this week I was able to get clang-cl on Windows to be
able to self host. This opened the door to being able to
get a whole new slew of warnings for the Windows build.
This patch fixes all of the warnings, many of which were real
bugs.
llvm-svn: 230522
27 files changed, 45 insertions, 60 deletions
diff --git a/lldb/include/lldb/API/SBCommunication.h b/lldb/include/lldb/API/SBCommunication.h index fa60e6339a1..eec90d22f0b 100644 --- a/lldb/include/lldb/API/SBCommunication.h +++ b/lldb/include/lldb/API/SBCommunication.h @@ -18,7 +18,7 @@ namespace lldb { class LLDB_API SBCommunication { public: - enum { + enum : unsigned { eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost. eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available. eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients. diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index 1dc5cc2981c..4de0b55862b 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -21,7 +21,6 @@ namespace lldb { class LLDB_API SBValue { -friend class ValueLocker; public: SBValue (); diff --git a/lldb/include/lldb/Core/Communication.h b/lldb/include/lldb/Core/Communication.h index 49532fe123c..bd613009801 100644 --- a/lldb/include/lldb/Core/Communication.h +++ b/lldb/include/lldb/Core/Communication.h @@ -85,14 +85,14 @@ namespace lldb_private { class Communication : public Broadcaster { public: - enum { - eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost. - eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available. - eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients. - eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread. - eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet. - kLoUserBroadcastBit = (1 << 16),///< Subclasses can used bits 31:16 for any needed events. - kHiUserBroadcastBit = (1 << 31), + enum : unsigned { + eBroadcastBitDisconnected = (1u << 0), ///< Sent when the communications connection is lost. + eBroadcastBitReadThreadGotBytes = (1u << 1), ///< Sent by the read thread when bytes become available. + eBroadcastBitReadThreadDidExit = (1u << 2), ///< Sent by the read thread when it exits to inform clients. + eBroadcastBitReadThreadShouldExit = (1u << 3), ///< Sent by clients that need to cancel the read thread. + eBroadcastBitPacketAvailable = (1u << 4), ///< Sent when data received makes a complete packet. + kLoUserBroadcastBit = (1u << 16),///< Subclasses can used bits 31:16 for any needed events. + kHiUserBroadcastBit = (1u << 31), eAllEventBits = 0xffffffff }; diff --git a/lldb/include/lldb/Host/OptionParser.h b/lldb/include/lldb/Host/OptionParser.h index 5aa7db5d34b..a169ce6ad6c 100644 --- a/lldb/include/lldb/Host/OptionParser.h +++ b/lldb/include/lldb/Host/OptionParser.h @@ -46,7 +46,7 @@ public: const char *optstring, const Option *longopts, int *longindex); - static char* GetOptionArgument(); + static const char* GetOptionArgument(); static int GetOptionIndex(); static int GetOptionErrorCause(); static std::string GetShortOptionString(struct option *long_options); diff --git a/lldb/include/lldb/Host/Socket.h b/lldb/include/lldb/Host/Socket.h index ee85f85fcaf..bad6553078a 100644 --- a/lldb/include/lldb/Host/Socket.h +++ b/lldb/include/lldb/Host/Socket.h @@ -34,8 +34,10 @@ namespace lldb_private { #if defined(_MSC_VER) typedef SOCKET NativeSocket; + inline bool IS_VALID_SOCKET(NativeSocket socket) { return socket != INVALID_SOCKET; } #else typedef int NativeSocket; + inline bool IS_VALID_SOCKET(NativeSocket socket) { return socket >= 0; } #endif class Socket : public IOObject diff --git a/lldb/include/lldb/Host/msvc/Config.h b/lldb/include/lldb/Host/msvc/Config.h index bdf404c4f46..ac7d9003bbe 100644 --- a/lldb/include/lldb/Host/msvc/Config.h +++ b/lldb/include/lldb/Host/msvc/Config.h @@ -29,7 +29,7 @@ #if _HAS_EXCEPTIONS == 0 // Exceptions are disabled so this isn't defined, but concrt assumes it is. -static void *__uncaught_exception() { return nullptr; } +inline void *__uncaught_exception() { return nullptr; } #endif #endif // #ifndef liblldb_Platform_Config_h_ diff --git a/lldb/include/lldb/Host/windows/getopt/GetOptInc.h b/lldb/include/lldb/Host/windows/getopt/GetOptInc.h index 53ce19daa8a..f58e063166f 100644 --- a/lldb/include/lldb/Host/windows/getopt/GetOptInc.h +++ b/lldb/include/lldb/Host/windows/getopt/GetOptInc.h @@ -21,7 +21,7 @@ struct option int getopt( int argc, char * const argv[], const char *optstring ); // from getopt.h -extern char * optarg; +extern const char * optarg; extern int optind; extern int opterr; extern int optopt; diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h index 94ed16e02ca..87177eab552 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h @@ -34,8 +34,6 @@ class ScriptInterpreterPython : { public: - friend class IOHandlerPythonInterpreter; - ScriptInterpreterPython (CommandInterpreter &interpreter); ~ScriptInterpreterPython (); diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index 51bd3dd82c9..fa79e967698 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -71,7 +71,7 @@ public: eEncodingIsSyntheticUID } EncodingDataType; - typedef enum ResolveStateTag + typedef enum ResolveStateTag : unsigned { eResolveStateUnresolved = 0, eResolveStateForward = 1, diff --git a/lldb/include/lldb/Target/SectionLoadHistory.h b/lldb/include/lldb/Target/SectionLoadHistory.h index 50dcfd3cc87..ddf46a1861c 100644 --- a/lldb/include/lldb/Target/SectionLoadHistory.h +++ b/lldb/include/lldb/Target/SectionLoadHistory.h @@ -23,7 +23,7 @@ namespace lldb_private { class SectionLoadHistory { public: - enum { + enum : unsigned { // Pass eStopIDNow to any function that takes a stop ID to get // the current value. eStopIDNow = UINT32_MAX diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 7b5ea7020fd..f5ef1e483db 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -652,7 +652,7 @@ namespace lldb { eBasicTypeOther } BasicType; - typedef enum TypeClass + typedef enum TypeClass : unsigned { eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0), diff --git a/lldb/source/Host/common/OptionParser.cpp b/lldb/source/Host/common/OptionParser.cpp index a91e764bfe3..edd8679d6ac 100644 --- a/lldb/source/Host/common/OptionParser.cpp +++ b/lldb/source/Host/common/OptionParser.cpp @@ -54,7 +54,7 @@ OptionParser::Parse (int argc, return getopt_long_only(argc, argv, optstring, &opts[0], longindex); } -char* +const char* OptionParser::GetOptionArgument() { return optarg; diff --git a/lldb/source/Host/common/Socket.cpp b/lldb/source/Host/common/Socket.cpp index b5559fffb45..46f36ed5947 100644 --- a/lldb/source/Host/common/Socket.cpp +++ b/lldb/source/Host/common/Socket.cpp @@ -699,7 +699,7 @@ int Socket::SetOption(int level, int option_name, int option_value) uint16_t Socket::GetLocalPortNumber(const NativeSocket& socket) { // We bound to port zero, so we need to figure out which port we actually bound to - if (socket >= 0) + if (IS_VALID_SOCKET(socket)) { SocketAddress sock_addr; socklen_t sock_addr_len = sock_addr.GetMaxLength (); @@ -730,7 +730,7 @@ std::string Socket::GetLocalIPAddress () const uint16_t Socket::GetRemotePortNumber () const { - if (m_socket >= 0) + if (IS_VALID_SOCKET(m_socket)) { SocketAddress sock_addr; socklen_t sock_addr_len = sock_addr.GetMaxLength (); @@ -743,7 +743,7 @@ uint16_t Socket::GetRemotePortNumber () const std::string Socket::GetRemoteIPAddress () const { // We bound to port zero, so we need to figure out which port we actually bound to - if (m_socket >= 0) + if (IS_VALID_SOCKET(m_socket)) { SocketAddress sock_addr; socklen_t sock_addr_len = sock_addr.GetMaxLength (); diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp index ca46eb0f744..9f3abb75e91 100644 --- a/lldb/source/Host/common/Terminal.cpp +++ b/lldb/source/Host/common/Terminal.cpp @@ -180,20 +180,18 @@ TerminalState::Save (int fd, bool save_process_group) bool TerminalState::Restore () const { +#ifndef LLDB_DISABLE_POSIX if (IsValid()) { const int fd = m_tty.GetFileDescriptor(); -#ifndef LLDB_DISABLE_POSIX if (TFlagsIsValid()) fcntl (fd, F_SETFL, m_tflags); -#endif #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED if (TTYStateIsValid()) tcsetattr (fd, TCSANOW, m_termios_ap.get()); #endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED -#ifndef LLDB_DISABLE_POSIX if (ProcessGroupIsValid()) { // Save the original signal handler. @@ -204,9 +202,9 @@ TerminalState::Restore () const // Restore the original signal handler. signal (SIGTTOU, saved_sigttou_callback); } -#endif return true; } +#endif return false; } diff --git a/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp b/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp index bbf315019aa..e2b23d0a0f5 100644 --- a/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp +++ b/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp @@ -208,9 +208,9 @@ ConnectionGenericFile::Read(void *dst, size_t dst_len, uint32_t timeout_usec, ll TimeValue time_value; time_value.OffsetWithMicroSeconds(timeout_usec); DWORD milliseconds = time_value.milliseconds(); - result = ::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles), m_event_handles, FALSE, milliseconds); + DWORD wait_result = ::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles), m_event_handles, FALSE, milliseconds); // All of the events are manual reset events, so make sure we reset them to non-signalled. - switch (result) + switch (wait_result) { case WAIT_OBJECT_0 + kBytesAvailableEvent: break; diff --git a/lldb/source/Host/windows/EditLineWin.cpp b/lldb/source/Host/windows/EditLineWin.cpp index 6bd7e161cd0..49f7def5976 100644 --- a/lldb/source/Host/windows/EditLineWin.cpp +++ b/lldb/source/Host/windows/EditLineWin.cpp @@ -247,10 +247,10 @@ el_set (EditLine *el, int code, ...) // get the function pointer from the arg list void *func_vp = (void*)va_arg(vl, el_prompt_func); - char escape = (char)va_arg(vl, int); + va_arg(vl, int); // call to get the prompt as a string el_prompt_func func_fp = (el_prompt_func)func_vp; - const char *newPrompt = func_fp(el); + func_fp(el); } break; diff --git a/lldb/source/Host/windows/HostProcessWindows.cpp b/lldb/source/Host/windows/HostProcessWindows.cpp index d8e407c667a..0f81c18d34a 100644 --- a/lldb/source/Host/windows/HostProcessWindows.cpp +++ b/lldb/source/Host/windows/HostProcessWindows.cpp @@ -120,7 +120,7 @@ HostProcessWindows::MonitorThread(void *thread_arg) MonitorInfo *info = static_cast<MonitorInfo *>(thread_arg); if (info) { - DWORD wait_result = ::WaitForSingleObject(info->process_handle, INFINITE); + ::WaitForSingleObject(info->process_handle, INFINITE); ::GetExitCodeProcess(info->process_handle, &exit_code); info->callback(info->baton, ::GetProcessId(info->process_handle), true, 0, exit_code); ::CloseHandle(info->process_handle); diff --git a/lldb/source/Host/windows/ThisThread.cpp b/lldb/source/Host/windows/ThisThread.cpp index 9c37d7c57e7..d5f5810b08e 100644 --- a/lldb/source/Host/windows/ThisThread.cpp +++ b/lldb/source/Host/windows/ThisThread.cpp @@ -20,8 +20,6 @@ using namespace lldb_private; namespace { -static const DWORD MS_VC_EXCEPTION = 0x406D1388; - #pragma pack(push, 8) struct THREADNAME_INFO { @@ -38,7 +36,9 @@ ThisThread::SetName(llvm::StringRef name) { // Other compilers don't yet support SEH, so we can only set the thread if compiling with MSVC. // TODO(zturner): Once clang-cl supports SEH, relax this conditional. -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) /* clang-cl doesn't support SEH */ + static const DWORD MS_VC_EXCEPTION = 0x406D1388; + THREADNAME_INFO info; info.dwType = 0x1000; info.szName = name.data(); diff --git a/lldb/source/Host/windows/getopt/GetOptInc.cpp b/lldb/source/Host/windows/getopt/GetOptInc.cpp index 612fc9f8147..cae310326f5 100644 --- a/lldb/source/Host/windows/getopt/GetOptInc.cpp +++ b/lldb/source/Host/windows/getopt/GetOptInc.cpp @@ -9,7 +9,7 @@ int opterr = 1; /* if error message should be printed */ int optind = 1; /* index into parent argv vector */ int optopt = '?'; /* character checked for validity */ int optreset; /* reset getopt */ -char *optarg; /* argument associated with option */ +const char *optarg; /* argument associated with option */ #define PRINT_ERROR ((opterr) && (*options != ':')) @@ -31,20 +31,12 @@ static int parse_long_options(char * const *, const char *, static int gcd(int, int); static void permute_args(int, int, int, char * const *); -static char *place = EMSG; /* option letter processing */ +static const char *place = EMSG; /* option letter processing */ /* XXX: set optreset to 1 rather than these two */ static int nonopt_start = -1; /* first non option argument (for permute) */ static int nonopt_end = -1; /* first option after non options (for permute) */ -/* Error messages */ -static const char recargchar[] = "option requires an argument -- %c"; -static const char recargstring[] = "option requires an argument -- %s"; -static const char ambig[] = "ambiguous option -- %.*s"; -static const char noarg[] = "option doesn't take an argument -- %.*s"; -static const char illoptchar[] = "unknown option -- %c"; -static const char illoptstring[] = "unknown option -- %s"; - /* * Compute the greatest common divisor of a and b. */ @@ -112,7 +104,7 @@ static int parse_long_options(char * const *nargv, const char *options, const struct option *long_options, int *idx, int short_too) { - char *current_argv, *has_equal; + const char *current_argv, *has_equal; size_t current_argv_len; int i, match; diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp index 72074d31a7d..a0d632fde5a 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -269,7 +269,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread, #if HEX_ABI_DEBUG // print the original stack pointer - printf( "sp : %04lx \n", sp ); + printf( "sp : %04llx \n", sp ); #endif // make sure number of parameters matches prototype @@ -337,7 +337,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread, uint32_t data = 0; lldb::addr_t addr = sp + i * 4; proc->ReadMemory( addr, (void*)&data, sizeof( data ), error ); - printf( "\n0x%04lx 0x%08x ", addr, data ); + printf( "\n0x%04llx 0x%08x ", addr, data ); if ( i == 0 ) printf( "<<-- sp" ); } printf( "\n" ); diff --git a/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp b/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp index 7021f785221..df75bf72206 100644 --- a/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp +++ b/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp @@ -79,7 +79,6 @@ DebuggerThread::DebuggerThreadRoutine(const ProcessLaunchInfo &launch_info) // Grab a shared_ptr reference to this so that we know it won't get deleted until after the // thread routine has exited. std::shared_ptr<DebuggerThread> this_ref(shared_from_this()); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS)); Error error; ProcessLauncherWindows launcher; diff --git a/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h b/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h index 11fa1a82904..8aade4d3e74 100644 --- a/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h @@ -40,7 +40,7 @@ namespace lldb_private class LocalDebugDelegate : public IDebugDelegate { public: - explicit LocalDebugDelegate::LocalDebugDelegate(lldb::ProcessSP process); + explicit LocalDebugDelegate(lldb::ProcessSP process); virtual void OnExitProcess(uint32_t exit_code) override; virtual void OnDebuggerConnected(lldb::addr_t image_base) override; diff --git a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp index 0e0701ab3ac..8c379477bc2 100644 --- a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp @@ -55,8 +55,8 @@ class ProcessWindowsData { public: ProcessWindowsData(const ProcessLaunchInfo &launch_info) - : m_initial_stop_event(nullptr) - , m_launch_info(launch_info) + : m_launch_info(launch_info) + , m_initial_stop_event(nullptr) , m_initial_stop_received(false) { m_initial_stop_event = ::CreateEvent(nullptr, TRUE, FALSE, nullptr); @@ -330,7 +330,6 @@ ProcessWindows::RefreshStateAfterStop() BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc - 1)); if (site && site->ValidForThisThread(stop_thread.get())) { - lldb::break_id_t break_id = LLDB_INVALID_BREAK_ID; stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(*stop_thread, site->GetID()); register_context->SetPC(pc - 1); } @@ -389,7 +388,6 @@ void ProcessWindows::DidLaunch() { llvm::sys::ScopedLock lock(m_mutex); - StateType state = GetPrivateState(); // The initial stop won't broadcast the state change event, so account for that here. if (m_session_data && GetPrivateState() == eStateStopped && m_session_data->m_launch_info.GetFlags().Test(eLaunchFlagStopAtEntry)) @@ -553,7 +551,6 @@ ProcessWindows::OnDebugException(bool first_chance, const ExceptionRecord &recor } ExceptionResult result = ExceptionResult::SendToApplication; - lldb::StateType state = GetPrivateState(); switch (record.GetExceptionCode()) { case EXCEPTION_BREAKPOINT: diff --git a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp index b57f33f0dd5..6cc60ee04a3 100644 --- a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp @@ -38,7 +38,7 @@ TargetThreadWindows::~TargetThreadWindows() void TargetThreadWindows::RefreshStateAfterStop() { - DWORD old_suspend_count = ::SuspendThread(m_host_thread.GetNativeThread().GetSystemHandle()); + ::SuspendThread(m_host_thread.GetNativeThread().GetSystemHandle()); GetRegisterContext()->InvalidateIfNeeded(false); } diff --git a/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp index 46f76b66792..9051e9244b7 100644 --- a/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp @@ -93,8 +93,8 @@ RegisterSet g_register_sets[] = { //------------------------------------------------------------------ RegisterContextWindows_x86::RegisterContextWindows_x86(Thread &thread, uint32_t concrete_frame_idx) : RegisterContext(thread, concrete_frame_idx) - , m_context_stale(true) , m_context() + , m_context_stale(true) { } diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 2a76e88f2bb..7a93337f002 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -5010,7 +5010,6 @@ public: if (OpenPipes()) { const int read_fd = m_read_file.GetDescriptor(); - const int pipe_read_fd = m_pipe.GetReadFileDescriptor(); TerminalState terminal_state; terminal_state.Save (read_fd, false); Terminal terminal(read_fd); @@ -5018,6 +5017,7 @@ public: terminal.SetEcho(false); // FD_ZERO, FD_SET are not supported on windows #ifndef _WIN32 + const int pipe_read_fd = m_pipe.GetReadFileDescriptor(); while (!GetIsDone()) { fd_set read_fdset; diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp index e728d4ab2a9..36d82aeb60e 100644 --- a/lldb/source/Utility/PseudoTerminal.cpp +++ b/lldb/source/Utility/PseudoTerminal.cpp @@ -235,14 +235,13 @@ PseudoTerminal::GetSlaveName (char *error_str, size_t error_len) const lldb::pid_t PseudoTerminal::Fork (char *error_str, size_t error_len) { + pid_t pid = LLDB_INVALID_PROCESS_ID; +#if !defined(_MSC_VER) if (error_str) error_str[0] = '\0'; - pid_t pid = LLDB_INVALID_PROCESS_ID; int flags = O_RDWR; -#if !defined(_MSC_VER) flags |= O_CLOEXEC; -#endif if (OpenFirstAvailableMaster (flags, error_str, error_len)) { // Successfully opened our master pseudo terminal @@ -300,6 +299,7 @@ PseudoTerminal::Fork (char *error_str, size_t error_len) // Do nothing and let the pid get returned! } } +#endif return pid; } |

