From 9b90344445d0a753e8a4a8a926c67d6a6c051c5e Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 21 Oct 2009 05:51:28 +0000 Subject: [PATCH] THRIFT-606. cpp: Fix build on Solaris Nevada git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@827890 13f79535-47bb-0310-9956-ffa450edef68 --- configure.ac | 1 + lib/cpp/src/protocol/TProtocol.h | 5 ++++- lib/cpp/src/server/TNonblockingServer.cpp | 4 ++++ lib/cpp/src/transport/TServerSocket.cpp | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6ab49db2..a3b0b4b8 100644 --- a/configure.ac +++ b/configure.ac @@ -142,6 +142,7 @@ dnl My best guess is that it is where glibc stashes its implementation dnl of the POSIX Real-Time Extensions. This seems necessary on Linux, dnl and we haven't yet found a system where this is a problem. AC_CHECK_LIB(rt, clock_gettime) +AC_CHECK_LIB(socket, setsockopt) AC_TYPE_INT16_T AC_TYPE_INT32_T diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h index bf38598c..7d7b0659 100644 --- a/lib/cpp/src/protocol/TProtocol.h +++ b/lib/cpp/src/protocol/TProtocol.h @@ -86,7 +86,10 @@ using apache::thrift::transport::TTransport; # define __LITTLE_ENDIAN LITTLE_ENDIAN # define __BIG_ENDIAN BIG_ENDIAN # else -# error "Cannot determine endianness" +# include +# define __BYTE_ORDER BOOST_BYTE_ORDER +# define __LITTLE_ENDIAN BOOST_LITTLE_ENDIAN +# define __BIG_ENDIAN BOOST_BIG_ENDIAN # endif #endif diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/server/TNonblockingServer.cpp index 32f021a2..10764550 100644 --- a/lib/cpp/src/server/TNonblockingServer.cpp +++ b/lib/cpp/src/server/TNonblockingServer.cpp @@ -29,6 +29,10 @@ #include #include +#ifndef AF_LOCAL +#define AF_LOCAL AF_UNIX +#endif + namespace apache { namespace thrift { namespace server { using namespace apache::thrift::protocol; diff --git a/lib/cpp/src/transport/TServerSocket.cpp b/lib/cpp/src/transport/TServerSocket.cpp index 3a4387e8..6b5bf05a 100644 --- a/lib/cpp/src/transport/TServerSocket.cpp +++ b/lib/cpp/src/transport/TServerSocket.cpp @@ -33,6 +33,10 @@ #include "TServerSocket.h" #include +#ifndef AF_LOCAL +#define AF_LOCAL AF_UNIX +#endif + namespace apache { namespace thrift { namespace transport { using namespace std; -- 2.17.1