MingW compilation (windows). Includes various refactoring to improve portability.

llvm-svn: 189107
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index e6d2043..833afd6 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -10,6 +10,9 @@
 #include "lldb/lldb-python.h"
 
 // C Includes
+#ifdef _WIN32
+#define _BSD_SOURCE // Required so that getopt.h defines optreset
+#endif
 #include <getopt.h>
 #include <cstdlib>
 // C++ Includes