summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Duncan Ogilvie2024-11-28 18:42:42 +0100
committerGravatar Nikias Bassen2024-11-29 04:27:50 +0100
commitc3ca555266ff0f241f32a8e8fc2a3ccdae6623fe (patch)
tree753eb06579771282c6bc0ee7eea12889953aeacd /tools
parent5d718587177561f3084ed13db4b72a56912d27f5 (diff)
downloadlibusbmuxd-c3ca555266ff0f241f32a8e8fc2a3ccdae6623fe.tar.gz
libusbmuxd-c3ca555266ff0f241f32a8e8fc2a3ccdae6623fe.tar.bz2
Fix compatibility with MSVC
Diffstat (limited to 'tools')
-rw-r--r--tools/inetcat.c16
-rw-r--r--tools/iproxy.c8
2 files changed, 17 insertions, 7 deletions
diff --git a/tools/inetcat.c b/tools/inetcat.c
index 1d52341..5db9349 100644
--- a/tools/inetcat.c
+++ b/tools/inetcat.c
@@ -31,15 +31,15 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
-#include <fcntl.h>
#include <stddef.h>
-#include <unistd.h>
#include <errno.h>
-#include <getopt.h>
+
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else
+#include <fcntl.h>
+#include <unistd.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -47,8 +47,16 @@
#include <signal.h>
#endif
-#include "usbmuxd.h"
+#ifdef _MSC_VER
+#include <basetsd.h>
+typedef SSIZE_T ssize_t;
+#define STDIN_FILENO _fileno(stdin)
+#define STDOUT_FILENO _fileno(stdout)
+#endif
+
+#include <getopt.h>
#include <libimobiledevice-glue/socket.h>
+#include "usbmuxd.h"
static int debug_level = 0;
diff --git a/tools/iproxy.c b/tools/iproxy.c
index 1a8e5b8..7427a54 100644
--- a/tools/iproxy.c
+++ b/tools/iproxy.c
@@ -32,20 +32,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <fcntl.h>
#include <stddef.h>
-#include <unistd.h>
#include <errno.h>
-#include <getopt.h>
+
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
typedef unsigned int socklen_t;
#else
+#include <fcntl.h>
+#include <unistd.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <signal.h>
#endif
+
+#include <getopt.h>
#include <libimobiledevice-glue/socket.h>
#include <libimobiledevice-glue/thread.h>
#include "usbmuxd.h"