aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelupus <elupus@xbmc.org>2011-05-06 21:16:22 +0200
committerelupus <elupus@xbmc.org>2011-05-10 19:17:21 +0200
commiteb7e967552cf72dd904747a17f7ff580a1daa35c (patch)
tree25e94fc0c5ae8a6b38ac8328057858e96824da16
parentc08f2fe6cfc677591ddad91b3b35ede497883d63 (diff)
added: posix socket headers on windows mapping to winsock
-rw-r--r--xbmc/win32/arpa/inet.h4
-rw-r--r--xbmc/win32/netdb.h2
-rw-r--r--xbmc/win32/netinet/in.h2
-rw-r--r--xbmc/win32/netinet/tcp.h2
-rw-r--r--xbmc/win32/sys/select.h2
-rw-r--r--xbmc/win32/sys/socket.h37
-rw-r--r--xbmc/win32/sys/time.h2
-rw-r--r--xbmc/win32/sys/types.h19
-rw-r--r--xbmc/win32/unistd.h3
9 files changed, 73 insertions, 0 deletions
diff --git a/xbmc/win32/arpa/inet.h b/xbmc/win32/arpa/inet.h
new file mode 100644
index 0000000000..0ec36264be
--- /dev/null
+++ b/xbmc/win32/arpa/inet.h
@@ -0,0 +1,4 @@
+#pragma once
+#include <sys/socket.h>
+
+extern "C" int inet_pton(int af, const char *src, void *dst);
diff --git a/xbmc/win32/netdb.h b/xbmc/win32/netdb.h
new file mode 100644
index 0000000000..f16b39a38d
--- /dev/null
+++ b/xbmc/win32/netdb.h
@@ -0,0 +1,2 @@
+#pragma once
+#include <sys/socket.h>
diff --git a/xbmc/win32/netinet/in.h b/xbmc/win32/netinet/in.h
new file mode 100644
index 0000000000..f16b39a38d
--- /dev/null
+++ b/xbmc/win32/netinet/in.h
@@ -0,0 +1,2 @@
+#pragma once
+#include <sys/socket.h>
diff --git a/xbmc/win32/netinet/tcp.h b/xbmc/win32/netinet/tcp.h
new file mode 100644
index 0000000000..f16b39a38d
--- /dev/null
+++ b/xbmc/win32/netinet/tcp.h
@@ -0,0 +1,2 @@
+#pragma once
+#include <sys/socket.h>
diff --git a/xbmc/win32/sys/select.h b/xbmc/win32/sys/select.h
new file mode 100644
index 0000000000..f16b39a38d
--- /dev/null
+++ b/xbmc/win32/sys/select.h
@@ -0,0 +1,2 @@
+#pragma once
+#include <sys/socket.h>
diff --git a/xbmc/win32/sys/socket.h b/xbmc/win32/sys/socket.h
new file mode 100644
index 0000000000..ef51ebc86a
--- /dev/null
+++ b/xbmc/win32/sys/socket.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <Winsock2.h>
+#include <WS2tcpip.h>
+#include <ws2bth.h>
+
+#ifndef SHUT_RDWR
+#define SHUT_RDWR SD_BOTH
+#endif
+
+#ifndef SHUT_RD
+#define SHUT_RD SD_RECEIVE
+#endif
+
+#ifndef SHUT_WR
+#define SHUT_WR SD_SEND
+#endif
+
+
+#ifndef AF_BTH
+#define AF_BTH 32
+#endif
+
+#ifndef BTHPROTO_RFCOMM
+#define BTHPROTO_RFCOMM 3
+#endif
+
+#ifndef AF_BLUETOOTH
+#define AF_BLUETOOTH AF_BTH
+#endif
+
+#ifndef BTPROTO_RFCOMM
+#define BTPROTO_RFCOMM BTHPROTO_RFCOMM
+#endif
+
+typedef int socklen_t;
+
diff --git a/xbmc/win32/sys/time.h b/xbmc/win32/sys/time.h
new file mode 100644
index 0000000000..4e3aa9e038
--- /dev/null
+++ b/xbmc/win32/sys/time.h
@@ -0,0 +1,2 @@
+#pragma once
+#include <Windows.h> \ No newline at end of file
diff --git a/xbmc/win32/sys/types.h b/xbmc/win32/sys/types.h
new file mode 100644
index 0000000000..3291019b92
--- /dev/null
+++ b/xbmc/win32/sys/types.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#ifndef _SIZE_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 size_t;
+#else
+typedef _W64 unsigned int size_t;
+#endif
+#define _SIZE_T_DEFINED
+#endif
+
+#if defined(_SSIZE_T_DEFINED) && !defined(ssize_t)
+#ifdef _WIN64
+typedef __int64 ssize_t;
+#else
+typedef _W64 int ssize_t;
+#endif
+#define _SSIZE_T_DEFINED
+#endif
diff --git a/xbmc/win32/unistd.h b/xbmc/win32/unistd.h
new file mode 100644
index 0000000000..3499ec091d
--- /dev/null
+++ b/xbmc/win32/unistd.h
@@ -0,0 +1,3 @@
+#pragma once
+#include <inttypes.h>
+#include <io.h>