summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Collett2012-07-05 14:47:36 (GMT)
committerTimothy Collett2012-07-05 14:47:36 (GMT)
commitd0b2d0750dc2d529a152eba4f3f519f69ff7eab0 (patch)
treea1d1018d52dd7fd5a8a432e71755dacf15b74f67
parentf2722ca9ac49f8f13da4ddcfcb0fa47a0eb30454 (diff)
downloadclsocket-d0b2d0750dc2d529a152eba4f3f519f69ff7eab0.tar.gz
clsocket-d0b2d0750dc2d529a152eba4f3f519f69ff7eab0.tar.bz2
clsocket-d0b2d0750dc2d529a152eba4f3f519f69ff7eab0.tar.xz
Re-fix the problems building clsocket on OS X by standardizing on _DARWIN
-rw-r--r--CMakeLists.txt6
-rwxr-xr-xsrc/SimpleSocket.cpp2
-rwxr-xr-xsrc/SimpleSocket.h8
3 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc30415..0795081 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,13 +29,15 @@ LIST(APPEND CLSOCKET_SOURCES ${CLSOCKET_HEADERS})
# OS and compiler checks.
if(UNIX)
+ # linux / normal unix
+ add_definitions(-D_LINUX)
if(CYGWIN)
# Special Cygwin stuff here
elseif(APPLE)
# Special Apple stuff here
+ remove_definitions(-D_LINUX)
+ add_definitions(-D_DARWIN)
endif()
- # linux / normal unix
- add_definitions(-D_LINUX)
elseif(WIN32)
add_definitions(-DWIN32)
SET(PROJECT_LIBS Ws2_32.lib)
diff --git a/src/SimpleSocket.cpp b/src/SimpleSocket.cpp
index a333e3e..2f9f434 100755
--- a/src/SimpleSocket.cpp
+++ b/src/SimpleSocket.cpp
@@ -92,7 +92,7 @@ CSimpleSocket::CSimpleSocket(CSocketType nType) :
//----------------------------------------------------------------------
case CSimpleSocket::SocketTypeRaw:
{
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(_DARWIN)
m_nSocketDomain = AF_PACKET;
m_nSocketType = CSimpleSocket::SocketTypeRaw;
#endif
diff --git a/src/SimpleSocket.h b/src/SimpleSocket.h
index 83ac880..17868d6 100755
--- a/src/SimpleSocket.h
+++ b/src/SimpleSocket.h
@@ -49,7 +49,7 @@
#include <stdarg.h>
#include <errno.h>
-#if defined(_LINUX) || defined (__APPLE__)
+#if defined(_LINUX) || defined (_DARWIN)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -57,16 +57,16 @@
#include <netinet/ip.h>
#include <netdb.h>
#endif
-#if defined(_LINUX) && !defined(__APPLE__)
+#ifdef _LINUX
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/if.h>
#include <sys/sendfile.h>
#endif
-#ifdef __APPLE__
+#ifdef _DARWIN
#include <net/if.h>
#endif
-#if defined(_LINUX) || defined (__APPLE__)
+#if defined(_LINUX) || defined (_DARWIN)
#include <sys/time.h>
#include <sys/uio.h>
#include <unistd.h>