Index: common/Common.cpp
===================================================================
--- common/Common.cpp	(revision 64a1f4efc694f9ec1fb33eaf1e6b29cf345d044a)
+++ common/Common.cpp	(revision 34bd549fb79df6652d25f7cdf8607dd95e60c67a)
@@ -8,4 +8,9 @@
    #include <fcntl.h>
    #include <assert.h>
+#elif defined MAC
+   #include <fcntl.h>
+   #include <assert.h>
+   #include <mach/clock.h>
+   #include <mach/mach.h>
 #endif
 
@@ -50,4 +55,8 @@
       assert(flags != -1);
       fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+   #elif defined MAC
+      int flags = fcntl(sock, F_GETFL,0);
+      assert(flags != -1);
+      fcntl(sock, F_SETFL, flags | O_NONBLOCK);
    #endif
 }
@@ -62,4 +71,16 @@
       timespec curTime;
       clock_gettime(CLOCK_REALTIME, &curTime);
+
+      numMilliseconds = curTime.tv_sec*(unsigned long long)1000+curTime.tv_nsec/(unsigned long long)1000000;
+   # elif defined MAC
+      timespec curTime;
+
+      clock_serv_t cclock;
+      mach_timespec_t mts;
+      host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+      clock_get_time(cclock, &mts);
+      mach_port_deallocate(mach_task_self(), cclock);
+      curTime.tv_sec = mts.tv_sec;
+      curTime.tv_nsec = mts.tv_nsec;
 
       numMilliseconds = curTime.tv_sec*(unsigned long long)1000+curTime.tv_nsec/(unsigned long long)1000000;
Index: common/Compiler.h
===================================================================
--- common/Compiler.h	(revision 64a1f4efc694f9ec1fb33eaf1e6b29cf345d044a)
+++ common/Compiler.h	(revision 34bd549fb79df6652d25f7cdf8607dd95e60c67a)
@@ -9,3 +9,5 @@
 #elif defined __posix
    #define LINUX
+#elif defined __APPLE__
+   #define MAC
 #endif
Index: common/MessageContainer.h
===================================================================
--- common/MessageContainer.h	(revision 64a1f4efc694f9ec1fb33eaf1e6b29cf345d044a)
+++ common/MessageContainer.h	(revision 34bd549fb79df6652d25f7cdf8607dd95e60c67a)
@@ -9,4 +9,6 @@
    #include <winsock2.h>
 #elif defined LINUX
+   #include <netinet/in.h>
+#elif defined MAC
    #include <netinet/in.h>
 #endif
Index: common/MessageProcessor.cpp
===================================================================
--- common/MessageProcessor.cpp	(revision 64a1f4efc694f9ec1fb33eaf1e6b29cf345d044a)
+++ common/MessageProcessor.cpp	(revision 34bd549fb79df6652d25f7cdf8607dd95e60c67a)
@@ -50,5 +50,7 @@
 
    // assume we don't care about the value of socklen
+   cout << "Waiting for message from server" << endl;
    int ret =  recvfrom(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)source, &socklen);
+   cout << "Returned from wait" << endl;
 
    if (ret == -1)
Index: common/Player.h
===================================================================
--- common/Player.h	(revision 64a1f4efc694f9ec1fb33eaf1e6b29cf345d044a)
+++ common/Player.h	(revision 34bd549fb79df6652d25f7cdf8607dd95e60c67a)
@@ -10,4 +10,6 @@
    #include <winsock2.h>
 #elif defined LINUX
+   #include <netinet/in.h>
+#elif defined MAC
    #include <netinet/in.h>
 #endif
