aboutsummaryrefslogtreecommitdiff
path: root/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'socket.h')
-rw-r--r--socket.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/socket.h b/socket.h
new file mode 100644
index 0000000..ccdb60c
--- /dev/null
+++ b/socket.h
@@ -0,0 +1,21 @@
+#ifndef __SOCKET_H
+#define __SOCKET_H
+
+#ifdef _WIN32
+ #include <io.h>
+ #include <winsock.h>
+#else
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <netdb.h>
+ #include <unistd.h>
+
+ #define closesocket close
+ #define SOCKET int
+ #define INVALID_SOCKET -1
+ #define SOCKET_ERROR -1
+#endif
+
+#endif