[Lldb-commits] [lldb] r105922 - in /lldb/trunk: source/Core/Args.cpp tools/driver/Driver.cpp

Eli Friedman eli.friedman at gmail.com
Sun Jun 13 12:18:49 PDT 2010


Author: efriedma
Date: Sun Jun 13 14:18:49 2010
New Revision: 105922

URL: http://llvm.org/viewvc/llvm-project?rev=105922&view=rev
Log:
Make getopt() use portable to Linux.


Modified:
    lldb/trunk/source/Core/Args.cpp
    lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/source/Core/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Args.cpp?rev=105922&r1=105921&r2=105922&view=diff
==============================================================================
--- lldb/trunk/source/Core/Args.cpp (original)
+++ lldb/trunk/source/Core/Args.cpp Sun Jun 13 14:18:49 2010
@@ -477,8 +477,12 @@
             }
         }
     }
+#ifdef __GLIBC__
+    optind = 0;
+#else
     optreset = 1;
     optind = 1;
+#endif
     int val;
     while (1)
     {
@@ -837,8 +841,12 @@
         }
     }
 
+#ifdef __GLIBC__
+    optind = 0;
+#else
     optreset = 1;
     optind = 1;
+#endif
     int val;
     while (1)
     {
@@ -974,8 +982,12 @@
         }
     }
 
+#ifdef __GLIBC__
+    optind = 0;
+#else
     optreset = 1;
     optind = 1;
+#endif
     opterr = 0;
 
     int val;

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=105922&r1=105921&r2=105922&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Sun Jun 13 14:18:49 2010
@@ -349,9 +349,12 @@
     }
 
     // Prepare for & make calls to getopt_long.
-
+#if __GLIBC__
+    optind = 0;
+#else
     optreset = 1;
     optind = 1;
+#endif
     int val;
     while (1)
     {





More information about the lldb-commits mailing list