]> git.tdb.fi Git - libs/net.git/blobdiff - source/types.h
Initial revision
[libs/net.git] / source / types.h
diff --git a/source/types.h b/source/types.h
new file mode 100644 (file)
index 0000000..f3ca3ab
--- /dev/null
@@ -0,0 +1,28 @@
+/* $Id$
+
+This file is part of libmspnet
+Copyright © 2008  Mikkosoft Productions, Mikko Rasa
+Distributed under the LGPL
+*/
+
+#ifndef MSP_NET_TYPES_H_
+#define MSP_NET_TYPES_H_
+
+namespace Msp {
+namespace Net {
+
+#ifdef WIN32
+typedef SOCKET SocketHandle;
+typedef int socklen_t;
+
+#define MSP_NET_INVALID_SOCKET_HANDLE static_cast<SOCKET>(-1)
+#else
+typedef IO::Handle SocketHandle;
+
+#define MSP_NET_INVALID_SOCKET_HANDLE MSP_IO_INVALID_HANDLE
+#endif
+
+} // namespace Net
+} // namespace Msp
+
+#endif