summaryrefslogtreecommitdiff
path: root/lib/server
diff options
context:
space:
mode:
Diffstat (limited to 'lib/server')
-rwxr-xr-xlib/server/Daemon.cpp4
-rwxr-xr-xlib/server/Protocol.cpp12
-rwxr-xr-xlib/server/ProtocolWire.h4
-rwxr-xr-xlib/server/SSLLib.cpp4
-rwxr-xr-xlib/server/Socket.cpp4
-rwxr-xr-xlib/server/SocketListen.h4
-rwxr-xr-xlib/server/SocketStream.cpp8
7 files changed, 20 insertions, 20 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp
index bb4ecd7c..ca2df62f 100755
--- a/lib/server/Daemon.cpp
+++ b/lib/server/Daemon.cpp
@@ -520,7 +520,7 @@ void Daemon::SetProcessTitle(const char *format, ...)
// -- make sure other platforms include the image name somewhere so ps listings give
// useful information.
-#ifdef PLATFORM_HAVE_setproctitle
+#ifdef HAVE_SETPROCTITLE
// optional arguments
va_list args;
va_start(args, format);
@@ -532,7 +532,7 @@ void Daemon::SetProcessTitle(const char *format, ...)
// Set process title
::setproctitle("%s", title);
-#endif // PLATFORM_HAVE_setproctitle
+#endif // HAVE_SETPROCTITLE
}
diff --git a/lib/server/Protocol.cpp b/lib/server/Protocol.cpp
index 690c2ec0..988d44c8 100755
--- a/lib/server/Protocol.cpp
+++ b/lib/server/Protocol.cpp
@@ -423,13 +423,13 @@ void Protocol::Read(int64_t &rOut)
READ_START_CHECK
READ_CHECK_BYTES_AVAILABLE(sizeof(int64_t))
-#ifdef PLATFORM_ALIGN_INT
+#ifdef HAVE_ALIGNED_ONLY_INT64
int64_t nvalue;
memcpy(&nvalue, mpBuffer + mReadOffset, sizeof(int64_t));
#else
int64_t nvalue = *((int64_t*)(mpBuffer + mReadOffset));
#endif
- rOut = ntoh64(nvalue);
+ rOut = box_ntoh64(nvalue);
mReadOffset += sizeof(int64_t);
}
@@ -447,7 +447,7 @@ void Protocol::Read(int32_t &rOut)
READ_START_CHECK
READ_CHECK_BYTES_AVAILABLE(sizeof(int32_t))
-#ifdef PLATFORM_ALIGN_INT
+#ifdef HAVE_ALIGNED_ONLY_INT32
int32_t nvalue;
memcpy(&nvalue, mpBuffer + mReadOffset, sizeof(int32_t));
#else
@@ -558,8 +558,8 @@ void Protocol::Write(int64_t Value)
WRITE_START_CHECK
WRITE_ENSURE_BYTES_AVAILABLE(sizeof(int64_t))
- int64_t nvalue = hton64(Value);
-#ifdef PLATFORM_ALIGN_INT
+ int64_t nvalue = box_hton64(Value);
+#ifdef HAVE_ALIGNED_ONLY_INT64
memcpy(mpBuffer + mWriteOffset, &nvalue, sizeof(int64_t));
#else
*((int64_t*)(mpBuffer + mWriteOffset)) = nvalue;
@@ -582,7 +582,7 @@ void Protocol::Write(int32_t Value)
WRITE_ENSURE_BYTES_AVAILABLE(sizeof(int32_t))
int32_t nvalue = htonl(Value);
-#ifdef PLATFORM_ALIGN_INT
+#ifdef HAVE_ALIGNED_ONLY_INT32
memcpy(mpBuffer + mWriteOffset, &nvalue, sizeof(int32_t));
#else
*((int32_t*)(mpBuffer + mWriteOffset)) = nvalue;
diff --git a/lib/server/ProtocolWire.h b/lib/server/ProtocolWire.h
index b6d3bd37..ff62b66e 100755
--- a/lib/server/ProtocolWire.h
+++ b/lib/server/ProtocolWire.h
@@ -13,7 +13,7 @@
#include <sys/types.h>
// set packing to one byte
-#ifdef STRUCTURE_PATCKING_FOR_WIRE_USE_HEADERS
+#ifdef STRUCTURE_PACKING_FOR_WIRE_USE_HEADERS
#include "BeginStructPackForWire.h"
#else
BEGIN_STRUCTURE_PACKING_FOR_WIRE
@@ -33,7 +33,7 @@ typedef struct
#define SPECIAL_STREAM_OBJECT_TYPE 0xffffffff
// Use default packing
-#ifdef STRUCTURE_PATCKING_FOR_WIRE_USE_HEADERS
+#ifdef STRUCTURE_PACKING_FOR_WIRE_USE_HEADERS
#include "EndStructPackForWire.h"
#else
END_STRUCTURE_PACKING_FOR_WIRE
diff --git a/lib/server/SSLLib.cpp b/lib/server/SSLLib.cpp
index e9f3a59d..9e98550a 100755
--- a/lib/server/SSLLib.cpp
+++ b/lib/server/SSLLib.cpp
@@ -45,8 +45,8 @@ void SSLLib::Initialise()
::SSL_load_error_strings();
// Extra seeding over and above what's already done by the library
-#ifndef PLATFORM_RANDOM_DEVICE_NONE
- if(::RAND_load_file(PLATFORM_RANDOM_DEVICE, 1024) != 1024)
+#ifdef HAVE_RANDOM_DEVICE
+ if(::RAND_load_file(RANDOM_DEVICE, 1024) != 1024)
{
THROW_EXCEPTION(ServerException, SSLRandomInitFailed)
}
diff --git a/lib/server/Socket.cpp b/lib/server/Socket.cpp
index 52eb79e3..b2d32345 100755
--- a/lib/server/Socket.cpp
+++ b/lib/server/Socket.cpp
@@ -49,7 +49,7 @@ void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain, int Type
if(phost->h_addr_list[0] != 0)
{
sockAddrLen = sizeof(addr.sa_inet);
-#ifndef PLATFORM_sockaddr_NO_len
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
addr.sa_inet.sin_len = sizeof(addr.sa_inet);
#endif
addr.sa_inet.sin_family = PF_INET;
@@ -82,7 +82,7 @@ void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain, int Type
THROW_EXCEPTION(ServerException, SocketNameUNIXPathTooLong);
}
sockAddrLen = nameLen + (((char*)(&(addr.sa_unix.sun_path[0]))) - ((char*)(&addr.sa_unix)));
-#ifndef PLATFORM_sockaddr_NO_len
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
addr.sa_unix.sun_len = sockAddrLen;
#endif
addr.sa_unix.sun_family = PF_UNIX;
diff --git a/lib/server/SocketListen.h b/lib/server/SocketListen.h
index f1f5e377..7042011c 100755
--- a/lib/server/SocketListen.h
+++ b/lib/server/SocketListen.h
@@ -16,7 +16,7 @@
#include <poll.h>
#include <memory>
#include <string>
-#ifndef PLATFORM_KQUEUE_NOT_SUPPORTED
+#ifdef HAVE_KQUEUE
#include <sys/event.h>
#include <sys/time.h>
#endif
@@ -226,7 +226,7 @@ public:
// Functions to allow adding to WaitForEvent class, for efficient waiting
// on multiple sockets.
-#ifndef PLATFORM_KQUEUE_NOT_SUPPORTED
+#ifdef HAVE_KQUEUE
// --------------------------------------------------------------------------
//
// Function
diff --git a/lib/server/SocketStream.cpp b/lib/server/SocketStream.cpp
index 3c8bf453..53865ee3 100755
--- a/lib/server/SocketStream.cpp
+++ b/lib/server/SocketStream.cpp
@@ -372,7 +372,7 @@ int SocketStream::GetSocketHandle()
// --------------------------------------------------------------------------
bool SocketStream::GetPeerCredentials(uid_t &rUidOut, gid_t &rGidOut)
{
-#ifdef PLATFORM_HAVE_getpeereid
+#ifdef HAVE_GETPEEREID
uid_t remoteEUID = 0xffff;
gid_t remoteEGID = 0xffff;
@@ -382,9 +382,9 @@ bool SocketStream::GetPeerCredentials(uid_t &rUidOut, gid_t &rGidOut)
rGidOut = remoteEGID;
return true;
}
-#endif // PLATFORM_HAVE_getpeereid
+#endif
-#ifdef PLATFORM_HAVE_getsockopt_SO_PEERCRED
+#if HAVE_DECL_SO_PEERCRED
struct ucred cred;
socklen_t credLen = sizeof(cred);
@@ -394,7 +394,7 @@ bool SocketStream::GetPeerCredentials(uid_t &rUidOut, gid_t &rGidOut)
rGidOut = cred.gid;
return true;
}
-#endif // PLATFORM_HAVE_getsockopt_SO_PEERCRED
+#endif
// Not available
return false;