    // we don't expose Channel to client.
    boost::scoped_ptr<Channel> wakeupChannel_;
 diff --git a/muduo/net/InetAddress.cc b/muduo/net/InetAddress.cc
-index 368b837..f59be46 100644
+index 24db014..13352cc 100644
 --- a/muduo/net/InetAddress.cc
 +++ b/muduo/net/InetAddress.cc
-@@ -17,9 +17,7 @@
+@@ -19,10 +19,10 @@
  #include <boost/static_assert.hpp>
  
  // INADDR_ANY use (type)value casting.
 -#pragma GCC diagnostic ignored "-Wold-style-cast"
++// #pragma GCC diagnostic ignored "-Wold-style-cast"
  static const in_addr_t kInaddrAny = INADDR_ANY;
+ static const in_addr_t kInaddrLoopback = INADDR_LOOPBACK;
 -#pragma GCC diagnostic error "-Wold-style-cast"
++// #pragma GCC diagnostic error "-Wold-style-cast"
  
  //     /* Structure describing an Internet socket address.  */
  //     struct sockaddr_in {
+@@ -78,10 +78,15 @@ bool InetAddress::resolve(const char* hostname, InetAddress* out)
+   assert(out != NULL);
+   struct hostent hent;
+   struct hostent* he = NULL;
+-  int herrno = 0;
+   bzero(&hent, sizeof(hent));
+ 
++#ifndef __MACH__
++  int herrno = 0;
+   int ret = gethostbyname_r(hostname, &hent, t_resolveBuffer, sizeof t_resolveBuffer, &he, &herrno);
++#else
++  he = gethostbyname(hostname);
++  int ret = 0;
++#endif
+   if (ret == 0 && he != NULL)
+   {
+     assert(he->h_addrtype == AF_INET && he->h_length == sizeof(uint32_t));
 diff --git a/muduo/net/SocketsOps.cc b/muduo/net/SocketsOps.cc
-index 24a4433..266f508 100644
+index 7839754..73a021b 100644
 --- a/muduo/net/SocketsOps.cc
 +++ b/muduo/net/SocketsOps.cc
-@@ -17,6 +17,9 @@
+@@ -17,12 +17,15 @@
  #include <stdio.h>  // snprintf
  #include <strings.h>  // bzero
  #include <sys/socket.h>

     oss << "ERR ";
   if (revents_ & POLLNVAL)
diff --git a/muduo/net/Endian.h b/muduo/net/Endian.h
index 0ca95e9..fa085bd 100644
--- a/muduo/net/Endian.h
+++ b/muduo/net/Endian.h
@@ -12,7 +12,28 @@

 
   std::vector<Entry> expired = getExpired(now);
 
@@ -237,11 +193,6 @@ void TimerQueue::reset(const std::vector<Entry>& expired, Timestamp now)
   {
     nextExpire = timers_.begin()->second->expiration();
   }
