[Lldb-commits] [lldb] r203781 - Hide some declarations from mingw.
Hafiz_Abid at mentor.com
Mon Mar 17 05:09:24 PDT 2014
Probably I was not clear in the description. Previously whole of the file case surrounded by _MSC_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 _MSC_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.
Having said that, I am OK to go with your change if you still think that would be the better check.
From: Saleem Abdulrasool [mailto:compnerd at compnerd.org]
Sent: 15 March 2014 02:54
To: Abid, Hafiz
Cc: lldb-commits at cs.uiuc.edu
Subject: Re: [Lldb-commits] [lldb] r203781 - Hide some declarations from mingw.
On Thu, Mar 13, 2014 at 3:42 AM, Hafiz Abid Qadeer <hafiz_abid at mentor.com<mailto:hafiz_abid at mentor.com>> wrote:
Date: Thu Mar 13 05:42:28 2014
New Revision: 203781
Hide some declarations from mingw.
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.
--- lldb/trunk/tools/driver/Platform.cpp (original)
+++ lldb/trunk/tools/driver/Platform.cpp Thu Mar 13 05:42:28 2014
@@ -84,6 +84,7 @@ tcgetattr (int fildes, struct termios *t
signal (int sig, sighandler_t sigFunc)
@@ -106,5 +107,6 @@ signal (int sig, sighandler_t sigFunc)
--- lldb/trunk/tools/driver/Platform.h (original)
+++ lldb/trunk/tools/driver/Platform.h Thu Mar 13 05:42:28 2014
@@ -16,18 +16,13 @@
// this will stop signal.h being included
+#if defined( _MSC_VER )
- struct timeval
- long tv_sec;
- long tv_usec;
@@ -65,13 +60,8 @@
speed_t c_ospeed; // output speed
- typedef long pid_t;
#define STDIN_FILENO 0
- #define PATH_MAX MAX_PATH
- #define snprintf _snprintf
extern int ioctl( int d, int request, ... );
extern int kill ( pid_t pid, int sig );
extern int tcsetattr( int fd, int optional_actions, const struct termios *termios_p );
@@ -86,7 +76,18 @@
#define SIG_DFL ( (sighandler_t) -1 )
#define SIG_IGN ( (sighandler_t) -2 )
+ struct timeval
+ long tv_sec;
+ long tv_usec;
+ typedef long pid_t;
+ #define snprintf _snprintf
extern sighandler_t signal( int sig, sighandler_t );
+ #define PATH_MAX MAX_PATH
lldb-commits mailing list
lldb-commits at cs.uiuc.edu<mailto:lldb-commits at cs.uiuc.edu>
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-commits