//===-- source/Host/common/OptionParser.cpp ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "lldb/Host/OptionParser.h" #include "lldb/Host/HostGetOpt.h" #include "lldb/lldb-private-types.h" #include using namespace lldb_private; void OptionParser::Prepare(std::unique_lock &lock) { static std::mutex g_mutex; lock = std::unique_lock(g_mutex); #ifdef __GLIBC__ optind = 0; #else optreset = 1; optind = 1; #endif } void OptionParser::EnableError(bool error) { opterr = error ? 1 : 0; } int OptionParser::Parse(int argc, char *const argv[], llvm::StringRef optstring, const Option *longopts, int *longindex) { std::vector