diff options
| author | 2010-05-26 20:30:02 +0200 | |
|---|---|---|
| committer | 2010-05-26 20:30:02 +0200 | |
| commit | 0833499c76f78da21fc33874a485946189a33dad (patch) | |
| tree | 3406bc2729986945020748d176d492c6c4a4628a /tools/iproxy.c | |
| parent | 6cb505257ff848aa7ead80b60b575effc3a915fa (diff) | |
| download | usbmuxd-0833499c76f78da21fc33874a485946189a33dad.tar.gz usbmuxd-0833499c76f78da21fc33874a485946189a33dad.tar.bz2 | |
libusbmuxd: use winsock API for win32
Diffstat (limited to 'tools/iproxy.c')
| -rw-r--r-- | tools/iproxy.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/iproxy.c b/tools/iproxy.c index 707724a..1855c67 100644 --- a/tools/iproxy.c +++ b/tools/iproxy.c | |||
| @@ -30,11 +30,17 @@ TODO: improve code... | |||
| 30 | #include <string.h> | 30 | #include <string.h> |
| 31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
| 32 | #include <stddef.h> | 32 | #include <stddef.h> |
| 33 | #include <sys/socket.h> | ||
| 34 | #include <sys/un.h> | ||
| 35 | #include <unistd.h> | 33 | #include <unistd.h> |
| 36 | #include <errno.h> | 34 | #include <errno.h> |
| 35 | #ifdef WIN32 | ||
| 36 | #include <windows.h> | ||
| 37 | #include <winsock2.h> | ||
| 38 | typedef unsigned int socklen_t; | ||
| 39 | #else | ||
| 40 | #include <sys/socket.h> | ||
| 41 | #include <sys/un.h> | ||
| 37 | #include <arpa/inet.h> | 42 | #include <arpa/inet.h> |
| 43 | #endif | ||
| 38 | #include <pthread.h> | 44 | #include <pthread.h> |
| 39 | #include "sock_stuff.h" | 45 | #include "sock_stuff.h" |
| 40 | #include "usbmuxd.h" | 46 | #include "usbmuxd.h" |
| @@ -98,7 +104,7 @@ void *run_ctos_loop(void *arg) | |||
| 98 | int recv_len; | 104 | int recv_len; |
| 99 | int sent; | 105 | int sent; |
| 100 | char buffer[131072]; | 106 | char buffer[131072]; |
| 101 | pthread_t stoc = 0; | 107 | pthread_t stoc; |
| 102 | 108 | ||
| 103 | printf("%s: fd = %d\n", __func__, cdata->fd); | 109 | printf("%s: fd = %d\n", __func__, cdata->fd); |
| 104 | 110 | ||
