<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 17, 2014 at 5:09 AM, Abid, Hafiz <span dir="ltr"><<a href="mailto:Hafiz_Abid@mentor.com" target="_blank">Hafiz_Abid@mentor.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Probably I was not clear in the description. Previously whole of the file case surrounded by _<i>MSC</i>_VER which was changes to _WIN32 so that code can be
 used for other compilers too. But there are certain declarations which are probably only needed on MSVC so they were surrounded by _<i>MSC</i>_VER. I suspect some are not even needed for MSVC too e.g. struct timeval which seems to present in winsock2.h for
 both mingw and msvc. Defining snprintf to _snprintf is also a bit suspect as these functions have slightly different behaviour so I think it is better to restrict these definition to msvc.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Having said that, I am OK to go with your change if you still think that would be the better check.</span></p>
</div></div></blockquote><div><br></div><div>Ah, it was indeed the commit message that was misleading.  I think that the _MSC_VER is still slightly misleading as it is simply there to indicate that you are running against a pure MSVCRT environment rather than cygwin or MinGW.  But, I dont know of a better way to indicate that (in LLVM we would just use LLVM_ON_WIN32).</div>
<div><br></div><div>I do agree with your sentiment on simply defining snprintf to _snprintf as being dubious given the slightly different semantics of the two calls.</div><div><br></div><div>Thanks for the clarification!</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"> </p></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Abid<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Saleem Abdulrasool [mailto:<a href="mailto:compnerd@compnerd.org" target="_blank">compnerd@compnerd.org</a>]
<br>
<b>Sent:</b> 15 March 2014 02:54<br>
<b>To:</b> Abid, Hafiz<br>
<b>Cc:</b> <a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<b>Subject:</b> Re: [Lldb-commits] [lldb] r203781 - Hide some declarations from mingw.<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">On Thu, Mar 13, 2014 at 3:42 AM, Hafiz Abid Qadeer <<a href="mailto:hafiz_abid@mentor.com" target="_blank">hafiz_abid@mentor.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">Author: abidh<br>
Date: Thu Mar 13 05:42:28 2014<br>
New Revision: 203781<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=203781&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=203781&view=rev</a><br>
Log:<br>
Hide some declarations from mingw.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Given this description, I don't think that this change is the proper way to handle this.  Can you change the #ifdef _MSC_VER to if !defined(__MINGW32__) please?  _MSC_VER indicates that you are using either the Microsoft compiler or clang
 with Microsoft compatibility.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Modified:<br>
    lldb/trunk/tools/driver/Platform.cpp<br>
    lldb/trunk/tools/driver/Platform.h<br>
<br>
Modified: lldb/trunk/tools/driver/Platform.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.cpp?rev=203781&r1=203780&r2=203781&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.cpp?rev=203781&r1=203780&r2=203781&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/driver/Platform.cpp (original)<br>
+++ lldb/trunk/tools/driver/Platform.cpp Thu Mar 13 05:42:28 2014<br>
@@ -84,6 +84,7 @@ tcgetattr (int fildes, struct termios *t<br>
     return -1;<br>
 }<br>
<br>
+#ifdef _MSC_VER<br>
 sighandler_t<br>
 signal (int sig, sighandler_t sigFunc)<br>
 {<br>
@@ -106,5 +107,6 @@ signal (int sig, sighandler_t sigFunc)<br>
     }<br>
     return 0;<br>
 }<br>
+#endif<br>
<br>
 #endif<br>
<br>
Modified: lldb/trunk/tools/driver/Platform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.h?rev=203781&r1=203780&r2=203781&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.h?rev=203781&r1=203780&r2=203781&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/driver/Platform.h (original)<br>
+++ lldb/trunk/tools/driver/Platform.h Thu Mar 13 05:42:28 2014<br>
@@ -16,18 +16,13 @@<br>
<br>
     // this will stop signal.h being included<br>
     #define _INC_SIGNAL<br>
-<br>
     #include <io.h><br>
+#if defined( _MSC_VER )<br>
     #include <eh.h><br>
+#endif<br>
     #include <inttypes.h><br>
     #include "lldb/Host/windows/windows.h"<br>
<br>
-    struct timeval<br>
-    {<br>
-        long tv_sec;<br>
-        long tv_usec;<br>
-    };<br>
-<br>
     struct winsize<br>
     {<br>
         long ws_col;<br>
@@ -65,13 +60,8 @@<br>
         speed_t c_ospeed;  // output speed<br>
     };<br>
<br>
-    typedef long pid_t;<br>
-<br>
     #define STDIN_FILENO 0<br>
<br>
-    #define PATH_MAX MAX_PATH<br>
-    #define snprintf _snprintf<br>
-<br>
     extern int  ioctl( int d, int request, ... );<br>
     extern int  kill ( pid_t pid, int sig      );<br>
     extern int  tcsetattr( int fd, int optional_actions, const struct termios *termios_p );<br>
@@ -86,7 +76,18 @@<br>
     #define SIG_DFL ( (sighandler_t) -1 )<br>
     // ignored<br>
     #define SIG_IGN ( (sighandler_t) -2 )<br>
+<br>
+#ifdef _MSC_VER<br>
+    struct timeval<br>
+    {<br>
+        long tv_sec;<br>
+        long tv_usec;<br>
+    };<br>
+    typedef long pid_t;<br>
+    #define snprintf _snprintf<br>
     extern sighandler_t signal( int sig, sighandler_t );<br>
+    #define PATH_MAX MAX_PATH<br>
+#endif<br>
<br>
 #else<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><u></u><u></u></p>
</blockquote>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <br>
Saleem Abdulrasool<br>
compnerd (at) compnerd (dot) org <u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>