[Lldb-commits] [PATCH] Make build work on MinGW

Keno Fischer kfischer at college.harvard.edu
Thu Jul 31 14:30:13 PDT 2014


Yeah, I usually do the -U999999 thing, but forgot this time.

================
Comment at: include/lldb/Host/windows/win32.h:57
@@ -53,2 +56,3 @@
 #ifdef LLDB_DISABLE_PYTHON
+#ifdef __MINGW32__
 typedef uint32_t pid_t;
----------------
Zachary Turner wrote:
> Is this supposed to be #ifndef instead of #ifdef?  As it stands, this changes the behavior on native Win32.
Yes, I think you might be right about that. 

================
Comment at: source/Utility/PseudoTerminal.cpp:23-27
@@ -22,2 +22,7 @@
+
+#ifndef __MINGW32__
+#ifndef LLDB_DISABLE_PYTHON
 typedef uint32_t pid_t;
+#endif
+#endif
 // empty functions
----------------
Zachary Turner wrote:
> Little confused about what's going on here and why we're messing with pid_t in two different places (this file and win32.h) with different conditions.  Is it possible to centralize all the logic about what's going on with pid_t into win32.h?
Yes, I think that would be a good idea. I was trying to do the inverse condition of the one in win32.h here, to avoid it being defined twice. I think we should unify it in win32.h if possible. 

================
Comment at: tools/driver/Driver.cpp:919-924
@@ -912,3 +918,8 @@
         {
+#ifndef __MINGW32__
             int fd = mkstemp(lldb_cmds_file);
+#else
+            mktemp(lldb_cmds_file);
+            int fd = open(lldb_cmds_file,S_IRUSR|S_IWUSR|O_RDWR);
+#endif
             if (fd == -1)
----------------
Zachary Turner wrote:
> Can win32.h contain a definition of mkstemp?  Not a fan of pre-processor directives in source files, where avoidable.
Sure, that doesn't sound like a bad idea.

http://reviews.llvm.org/D4737






More information about the lldb-commits mailing list