summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Armstrong2012-04-17 23:48:24 (GMT)
committerDylan Armstrong2012-04-17 23:48:24 (GMT)
commit54cad7ca5431c8e27cfb90f51fdfaf69211f0a4f (patch)
treee08d4c07b6be6510a82d8682eb8b3dbf7e8c0038
parent49fa800615a4e5c872164bcb4122030d2ebda9cf (diff)
downloadclsocket-54cad7ca5431c8e27cfb90f51fdfaf69211f0a4f.tar.gz
clsocket-54cad7ca5431c8e27cfb90f51fdfaf69211f0a4f.tar.bz2
clsocket-54cad7ca5431c8e27cfb90f51fdfaf69211f0a4f.tar.xz
Added preliminary OSX support as well as updated outdated os macros
-rwxr-xr-xsrc/SimpleSocket.cpp4
-rwxr-xr-xsrc/SimpleSocket.h13
2 files changed, 10 insertions, 7 deletions
diff --git a/src/SimpleSocket.cpp b/src/SimpleSocket.cpp
index aa42ec1..fa386be 100755
--- a/src/SimpleSocket.cpp
+++ b/src/SimpleSocket.cpp
@@ -92,11 +92,11 @@ CSimpleSocket::CSimpleSocket(CSocketType nType) :
//----------------------------------------------------------------------
case CSimpleSocket::SocketTypeRaw:
{
-#ifdef _LINUX
+#ifdef __LINUX__
m_nSocketDomain = AF_PACKET;
m_nSocketType = CSimpleSocket::SocketTypeRaw;
#endif
-#ifdef WIN32
+#ifdef _WIN32
m_nSocketType = CSimpleSocket::SocketTypeInvalid;
#endif
break;
diff --git a/src/SimpleSocket.h b/src/SimpleSocket.h
index a35e760..23ed419 100755
--- a/src/SimpleSocket.h
+++ b/src/SimpleSocket.h
@@ -49,7 +49,7 @@
#include <stdarg.h>
#include <errno.h>
-#if defined(_LINUX) || defined (_DARWIN)
+#if defined(__LINUX__) || defined (__APPLE__)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -57,20 +57,23 @@
#include <netinet/ip.h>
#include <netdb.h>
#endif
-#ifdef _LINUX
-#include <linux/if_packet.h>
+#ifdef __LINUX__
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/if.h>
#include <sys/sendfile.h>
#endif
-#if defined(_LINUX) || defined (_DARWIN)
+#ifdef __APPLE__
+#include <net/if.h>
+#endif
+#if defined(_LINUX) || defined (__APPLE__)
#include <sys/time.h>
#include <sys/uio.h>
#include <unistd.h>
#include <fcntl.h>
#endif
-#ifdef WIN32
+
+#ifdef _WIN32
#include <io.h>
#include <winsock2.h>
#include <Ws2tcpip.h>