Date: Thursday, December 28, 2006 @ 18:55:07
  Author: marc
    Path: /cvsroot/carob/carob/src

Modified: SocketAddress.cpp (1.5 -> 1.6)

added missing includes for MacOSX


-------------------+
 SocketAddress.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+)


Index: carob/src/SocketAddress.cpp
diff -u carob/src/SocketAddress.cpp:1.5 carob/src/SocketAddress.cpp:1.6
--- carob/src/SocketAddress.cpp:1.5     Thu Dec 28 18:41:17 2006
+++ carob/src/SocketAddress.cpp Thu Dec 28 18:55:07 2006
@@ -23,9 +23,17 @@
 #include "Common.hpp" // for logging
 #include "StringCodecs.hpp"
 
+
 #include <ostream>
 #include <sstream>
 
+
+#if defined(__APPLE__) && defined(__MACH__)
+    // http://developer.apple.com/technotes/tn2002/tn2071.html#Section10w
+#include <sys/types.h> // inet_ntop
+#include <sys/socket.h>
+#endif
+
 #ifdef __MINGW32__
   #include <ws2tcpip.h>
 #else
@@ -79,6 +87,8 @@
     return (getFamily() < sa.getFamily());
   if (getFamily() == AF_INET) // ipv4
   {
+    // TODO: try instead a much faster:
+    // const sockaddr_in& this_in = reinterpret_cast<sockaddr_in>(address);
     sockaddr_in this_in, sa_in;
     memcpy(&this_in, &address, address_length);
     memcpy(&sa_in, &(sa.address), sa.address_length);
@@ -88,6 +98,7 @@
   }
   else if (getFamily() == AF_INET6)// ipv6
   {
+    // TODO see above
     sockaddr_in6 this_in6, sa_in6;
     memcpy(&this_in6, &address, address_length);
     memcpy(&sa_in6, &(sa.address), sa.address_length);

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to