Merge pull request #138 from Corysia/master

Changes for intel Mac OSX build
This commit is contained in:
Alex
2014-04-25 13:47:48 -07:00
16 changed files with 77 additions and 14 deletions
+4
View File
@@ -30,6 +30,10 @@
#ifdef FREEBSD //Timothy Whitman - January 7, 2003
#define MSG_NOSIGNAL 0
#endif
#ifdef DARWIN
#define MSG_NOSIGNAL SO_NOSIGPIPE // Corysia Taware - Sept. 27, 2013
// See http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html
#endif // DARWIN
#ifdef _WINDOWS
InitWinsock winsock;
+4
View File
@@ -97,8 +97,12 @@ void BaseTCPServer::ListenNewConnections() {
from.sin_family = AF_INET;
fromlen = sizeof(from);
LockMutex lock(&MSock);
#ifndef DARWIN // Corysia - On OSX, 0 is a valid fd.
if (!sock)
return;
#else
if (sock == -1) return;
#endif
// Check for pending connects
#ifdef _WINDOWS
+9 -2
View File
@@ -55,10 +55,17 @@ namespace EQEmu {
std::string final_name = name;
final_name += ".lock";
#ifdef __DARWIN
#if __DARWIN_C_LEVEL < 200809L
imp_->fd_ = open(final_name.c_str(),
O_RDWR | O_CREAT | O_CLOEXEC,
O_RDWR | O_CREAT,
S_IRUSR | S_IWUSR);
#else
imp_->fd_ = open(final_name.c_str(),
O_RDWR | O_CREAT | O_CLOEXEC,
S_IRUSR | S_IWUSR);
#endif
#endif
if(imp_->fd_ == -1) {
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
}