[PATCH 1/5] - correctly protecting system inclusion (needed for
Mingw compilation)
Eric Pouech
eric.pouech at wanadoo.fr
Sun Aug 13 13:46:40 CDT 2006
- compile out gdb proxy support for systems without poll() support
- removed no longer needed header files
A+
---
programs/winedbg/gdbproxy.c | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index e6b61e9..bef0187 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -34,27 +34,35 @@ #include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sys/poll.h>
-#include <sys/wait.h>
+#ifdef HAVE_SYS_POLL_H
+# include <sys/poll.h>
+#endif
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
-#include <netinet/in.h>
-#include <netinet/tcp.h>
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
+/* if we don't have POLLIN defined, we don't have poll support on this system
+ * so we won't provide gdb proxy support here...
+ */
+#ifdef POLLIN
#include "debugger.h"
#include "windef.h"
#include "winbase.h"
#include "tlhelp32.h"
-/* those two are needed only for the SHOWNORMAL flag */
-#include "wingdi.h"
-#include "winuser.h"
-
#define GDBPXY_TRC_LOWLEVEL 0x01
#define GDBPXY_TRC_PACKET 0x02
#define GDBPXY_TRC_COMMAND 0x04
@@ -2280,9 +2288,11 @@ static int gdb_remote(unsigned flags)
wait(NULL);
return 0;
}
+#endif
int gdb_main(int argc, char* argv[])
{
+#ifdef POLLIN
unsigned gdb_flags = 0;
argc--; argv++;
@@ -2305,6 +2315,9 @@ int gdb_main(int argc, char* argv[])
if (dbg_active_attach(argc, argv) == start_ok ||
dbg_active_launch(argc, argv) == start_ok)
return gdb_remote(gdb_flags);
+#else
+ fprintf(stderr, "GdbProxy mode not supported on this platform\n");
+#endif
return -1;
}
More information about the wine-patches
mailing list