diff options
| author | Stephen D. Huston <shuston@apache.org> | 2015-02-04 17:37:19 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2015-02-04 17:37:19 +0000 |
| commit | d75fedad65ae24813f440362931a9a7b7fb66cac (patch) | |
| tree | ed13f62fcb010d0ca07488f8c389a61abe982fbc /qpid/cpp | |
| parent | d3fd2da6c424e04725c7b40f097ea31036dab0f1 (diff) | |
| download | qpid-python-d75fedad65ae24813f440362931a9a7b7fb66cac.tar.gz | |
Apply patches for QPID-6312 to get Qpid building on AIX with XL C++ 13.1
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1657338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | qpid/cpp/INSTALL | 19 | ||||
| -rw-r--r-- | qpid/cpp/src/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | qpid/cpp/src/config.h.cmake | 1 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/InlineAllocator.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/Options.cpp | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/RangeSet.h | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/RefCounted.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/SessionId.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/amqp/MapEncoder.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/QueueRegistry.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/TopicKeyNode.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Filter.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/store/MessageStorePlugin.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/FreeBSD/uuid.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/Thread.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/posix/Thread.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/posix/Time.cpp | 14 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/sys/unordered_map.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/types/Variant.cpp | 10 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/TimerTest.cpp | 2 |
22 files changed, 73 insertions, 30 deletions
diff --git a/qpid/cpp/CMakeLists.txt b/qpid/cpp/CMakeLists.txt index 29a52cbb49..aaa4203c1e 100644 --- a/qpid/cpp/CMakeLists.txt +++ b/qpid/cpp/CMakeLists.txt @@ -182,6 +182,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) set (HIDE_SYMBOL_FLAGS "") endif (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) +# XL is IBM XL C/C++ +if (CMAKE_CXX_COMPILER_ID MATCHES XL) + set (COMPILER_FLAGS "-qtls -qrtti") +endif (CMAKE_CXX_COMPILER_ID MATCHES XL) + if (CMAKE_SYSTEM_NAME STREQUAL Windows) # Allow MSVC user to select 'WinXP-SP3/Windows Server 2003' as build target version set (win32_winnt_default OFF) diff --git a/qpid/cpp/INSTALL b/qpid/cpp/INSTALL index 0e91cddec8..717c9b0908 100644 --- a/qpid/cpp/INSTALL +++ b/qpid/cpp/INSTALL @@ -91,7 +91,7 @@ Or if you have only have a command line environment available 2.1 Building as C++11 (Experimental) ==================================== -Currently the Qpoid project uses C++ that conforms to the C++03 standard, as currently +Currently the Qpid project uses C++ that conforms to the C++03 standard, as currently this is the C++ standard that is supported the most widely, so any new code must also compile as C++03. As an experiment (and to support a few extra platforms) the Qpid code will also now build as C++11. @@ -141,6 +141,23 @@ If you want to use the ports version of cyrus-sasl then you should also add: Which will allow cmake to find libraries installed in /usr/local (which is where cyrus-sasl gets installed by ports). +2.4 Building on AIX +=================== +Qpid has been tested on AIX 7.1 with XL C++ 13.1 and Boost 1.55.0. The +thread-using variant of the compiler must be used but it isn't the default +picked up by cmake. Thus, the compiler must be specified at cmake time. +For example (assuming PATH includes the compiler binaries): + + # CXX=xlC_r CC=cc_r cmake .. + +Warnings from Boost header files are expected and can be ignored. + +It is normal to see (lots of) multiply-defined symbol warnings when linking +the shared libraries built as part of Qpid. + +The mktemp package must be installed separately in order to execute the +Qpid test suite. + 3. Building a Repository Working Copy ===================================== To get the source code from the subversion repository (trunk) do: diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt index 3e5165dfb0..8263534614 100644 --- a/qpid/cpp/src/CMakeLists.txt +++ b/qpid/cpp/src/CMakeLists.txt @@ -42,6 +42,7 @@ include(CheckIncludeFiles) include(CheckIncludeFileCXX) include(CheckLibraryExists) include(CheckSymbolExists) +include(CheckSizeTNativeType) find_package(PkgConfig) find_package(Ruby) @@ -350,6 +351,8 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows) mark_as_advanced(QPID_POLLER) endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows) +check_size_t_native_type (QPID_SIZE_T_NATIVE) + option(BUILD_SASL "Build with Cyrus SASL support" ${SASL_FOUND}) if (BUILD_SASL) if (NOT SASL_FOUND) @@ -684,6 +687,12 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows) ) endif (CMAKE_SYSTEM_NAME STREQUAL SunOS) + if (CMAKE_SYSTEM_NAME STREQUAL AIX) + set (qpid_system_module + qpid/sys/aix/SystemInfo.cpp + ) + endif (CMAKE_SYSTEM_NAME STREQUAL AIX) + if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) # -lmalloc needed for mallinfo. set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lmalloc") @@ -1145,6 +1154,9 @@ set_target_properties (qpidbroker PROPERTIES VERSION ${qpidbroker_version} SOVERSION ${qpidbroker_version_major} COMPILE_DEFINITIONS _IN_QPID_BROKER) +if (CMAKE_CXX_COMPILER_ID MATCHES XL) + set_target_properties (qpidbroker PROPERTIES LINK_FLAGS -Wl,-bbigtoc) +endif (CMAKE_CXX_COMPILER_ID MATCHES XL) if (MSVC) set_target_properties (qpidbroker PROPERTIES COMPILE_FLAGS /wd4290) diff --git a/qpid/cpp/src/config.h.cmake b/qpid/cpp/src/config.h.cmake index 777fc1b893..478b369eb6 100644 --- a/qpid/cpp/src/config.h.cmake +++ b/qpid/cpp/src/config.h.cmake @@ -56,6 +56,7 @@ #cmakedefine HAVE_SYS_SDT_H ${HAVE_SYS_SDT_H} #cmakedefine HAVE_LOG_AUTHPRIV #cmakedefine HAVE_LOG_FTP +#cmakedefine QPID_SIZE_T_NATIVE #cmakedefine HAVE_PROTON_TRACER #cmakedefine USE_PROTON_TRANSPORT_CONDITION #cmakedefine HAVE_PROTON_EVENTS diff --git a/qpid/cpp/src/qpid/InlineAllocator.h b/qpid/cpp/src/qpid/InlineAllocator.h index 2502545dcb..28ea73ec12 100644 --- a/qpid/cpp/src/qpid/InlineAllocator.h +++ b/qpid/cpp/src/qpid/InlineAllocator.h @@ -47,7 +47,7 @@ class InlineAllocator : public BaseAllocator { InlineAllocator() : allocated(false) {} InlineAllocator(const InlineAllocator& x) : BaseAllocator(x), allocated(false) {} - pointer allocate(size_type n) { + pointer allocate(size_type n, std::allocator<void>::const_pointer = 0) { if (n <= Max && !allocated) { allocated=true; return reinterpret_cast<value_type*>(address()); diff --git a/qpid/cpp/src/qpid/Options.cpp b/qpid/cpp/src/qpid/Options.cpp index cdba53449a..5ca91e6bd4 100644 --- a/qpid/cpp/src/qpid/Options.cpp +++ b/qpid/cpp/src/qpid/Options.cpp @@ -16,6 +16,7 @@ * */ +#include "config.h" #include "qpid/Options.h" #include "qpid/OptionsTemplates.h" #include "qpid/Exception.h" @@ -145,6 +146,9 @@ template QPID_COMMON_EXTERN po::value_semantic* create_value(int64_t& val, const template QPID_COMMON_EXTERN po::value_semantic* create_value(uint16_t& val, const std::string& arg); template QPID_COMMON_EXTERN po::value_semantic* create_value(uint32_t& val, const std::string& arg); template QPID_COMMON_EXTERN po::value_semantic* create_value(uint64_t& val, const std::string& arg); +#ifdef QPID_SIZE_T_NATIVE +template QPID_COMMON_EXTERN po::value_semantic* create_value(size_t& val, const std::string& arg); +#endif template QPID_COMMON_EXTERN po::value_semantic* create_value(double& val, const std::string& arg); template QPID_COMMON_EXTERN po::value_semantic* create_value(string& val, const std::string& arg); diff --git a/qpid/cpp/src/qpid/RangeSet.h b/qpid/cpp/src/qpid/RangeSet.h index 78677f1263..20ee722fcb 100644 --- a/qpid/cpp/src/qpid/RangeSet.h +++ b/qpid/cpp/src/qpid/RangeSet.h @@ -96,9 +96,9 @@ class Range { */ template <class T> class RangeSet - : boost::additive1<RangeSet<T>, - boost::additive2<RangeSet<T>, Range<T>, - boost::additive2<RangeSet<T>, T> > > + : private boost::additive1<RangeSet<T>, + boost::additive2<RangeSet<T>, Range<T>, + boost::additive2<RangeSet<T>, T> > > { typedef InlineVector<Range<T>, 3> Ranges; // TODO aconway 2008-04-21: what's the optimial inlined value? diff --git a/qpid/cpp/src/qpid/RefCounted.h b/qpid/cpp/src/qpid/RefCounted.h index 26e3e2c4ba..c2ec367658 100644 --- a/qpid/cpp/src/qpid/RefCounted.h +++ b/qpid/cpp/src/qpid/RefCounted.h @@ -33,7 +33,7 @@ namespace qpid { * to the class that has mixed this in not the class itself (as that would sidestep * the reference counting) */ -class RefCounted : boost::noncopyable { +class RefCounted : private boost::noncopyable { mutable boost::detail::atomic_count count; public: diff --git a/qpid/cpp/src/qpid/SessionId.h b/qpid/cpp/src/qpid/SessionId.h index e18b360999..d950ad9d1a 100644 --- a/qpid/cpp/src/qpid/SessionId.h +++ b/qpid/cpp/src/qpid/SessionId.h @@ -39,7 +39,7 @@ namespace qpid { * The name must be unique among sessions with the same authentication * principal. */ -class SessionId : boost::totally_ordered1<SessionId> { +class SessionId : private boost::totally_ordered1<SessionId> { std::string userId; std::string name; public: diff --git a/qpid/cpp/src/qpid/amqp/MapEncoder.h b/qpid/cpp/src/qpid/amqp/MapEncoder.h index 42fb819932..1481f9125a 100644 --- a/qpid/cpp/src/qpid/amqp/MapEncoder.h +++ b/qpid/cpp/src/qpid/amqp/MapEncoder.h @@ -31,7 +31,7 @@ struct Descriptor; /** * Encode map like data */ -class MapEncoder : public MapHandler, Encoder +class MapEncoder : public MapHandler, private Encoder { public: MapEncoder(char* data, size_t size); diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.h b/qpid/cpp/src/qpid/broker/QueueRegistry.h index 0eede36f3f..af4e8e50fb 100644 --- a/qpid/cpp/src/qpid/broker/QueueRegistry.h +++ b/qpid/cpp/src/qpid/broker/QueueRegistry.h @@ -44,7 +44,7 @@ class OwnershipToken; * are deleted when and only when they are no longer in use. * */ -class QueueRegistry : QueueFactory { +class QueueRegistry : private QueueFactory { public: QPID_BROKER_EXTERN QueueRegistry(Broker* b = 0); QPID_BROKER_EXTERN ~QueueRegistry(); diff --git a/qpid/cpp/src/qpid/broker/TopicKeyNode.h b/qpid/cpp/src/qpid/broker/TopicKeyNode.h index 7671ed069d..ac760b198e 100644 --- a/qpid/cpp/src/qpid/broker/TopicKeyNode.h +++ b/qpid/cpp/src/qpid/broker/TopicKeyNode.h @@ -166,7 +166,7 @@ class QPID_BROKER_CLASS_EXTERN TopicKeyNode { bool isHash; // children - typedef std::map<const std::string, typename TopicKeyNode::shared_ptr> ChildMap; + typedef std::map<std::string, typename TopicKeyNode::shared_ptr> ChildMap; ChildMap childTokens; typename TopicKeyNode::shared_ptr starChild; // "*" subtree typename TopicKeyNode::shared_ptr hashChild; // "#" subtree diff --git a/qpid/cpp/src/qpid/broker/amqp/Filter.h b/qpid/cpp/src/qpid/broker/amqp/Filter.h index e12e9e412b..c246fb9ede 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Filter.h +++ b/qpid/cpp/src/qpid/broker/amqp/Filter.h @@ -37,7 +37,7 @@ struct QueueSettings; namespace amqp { class Outgoing; -class Filter : qpid::amqp::MapReader +class Filter : private qpid::amqp::MapReader { public: Filter(); diff --git a/qpid/cpp/src/qpid/store/MessageStorePlugin.h b/qpid/cpp/src/qpid/store/MessageStorePlugin.h index 1fcde6683d..5290fc16db 100644 --- a/qpid/cpp/src/qpid/store/MessageStorePlugin.h +++ b/qpid/cpp/src/qpid/store/MessageStorePlugin.h @@ -267,7 +267,7 @@ class MessageStorePlugin : }; StoreOptions options; - typedef std::map<const std::string, StorageProvider*> ProviderMap; + typedef std::map<std::string, StorageProvider*> ProviderMap; ProviderMap providers; ProviderMap::const_iterator provider; diff --git a/qpid/cpp/src/qpid/sys/FreeBSD/uuid.cpp b/qpid/cpp/src/qpid/sys/FreeBSD/uuid.cpp index 4e4a1289d1..076056b2af 100644 --- a/qpid/cpp/src/qpid/sys/FreeBSD/uuid.cpp +++ b/qpid/cpp/src/qpid/sys/FreeBSD/uuid.cpp @@ -40,5 +40,5 @@ void uuid_generate (uint8_t out[qpid::sys::UuidSize]) out[7] = (uuid.time_hi_and_version & 0x00ff); out[8] = uuid.clock_seq_hi_and_reserved; out[9] = uuid.clock_seq_low; - ::memcpy(&out[10], &uuid.node, _UUID_NODE_LEN); + ::memcpy(&out[10], &uuid.node, sizeof(uuid.node)); } diff --git a/qpid/cpp/src/qpid/sys/Thread.h b/qpid/cpp/src/qpid/sys/Thread.h index f556612908..cb0a1adce6 100644 --- a/qpid/cpp/src/qpid/sys/Thread.h +++ b/qpid/cpp/src/qpid/sys/Thread.h @@ -34,6 +34,8 @@ # define QPID_TSS __thread #elif defined (__SUNPRO_CC) # define QPID_TSS __thread +#elif defined (__IBMCPP__) +# define QPID_TSS __thread #else # error "Dont know how to define QPID_TSS for this platform" #endif diff --git a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp index eebf02e867..7d04d2214d 100644 --- a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp +++ b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp @@ -93,7 +93,7 @@ private: AsynchAcceptor::AsynchAcceptor(const Socket& s, AsynchAcceptor::Callback callback) : acceptedCallback(callback), - handle(s, boost::bind(&AsynchAcceptor::readable, this, _1), 0, 0), + handle((const IOHandle&)s, boost::bind(&AsynchAcceptor::readable, this, _1), 0, 0), socket(s) { s.setNonblocking(); @@ -167,7 +167,7 @@ AsynchConnector::AsynchConnector(const Socket& s, const std::string& port, ConnectedCallback connCb, FailedCallback failCb) : - DispatchHandle(s, + DispatchHandle((const IOHandle&)s, 0, boost::bind(&AsynchConnector::connComplete, this, _1), boost::bind(&AsynchConnector::connComplete, this, _1)), @@ -308,7 +308,7 @@ AsynchIO::AsynchIO(const Socket& s, ReadCallback rCb, EofCallback eofCb, DisconnectCallback disCb, ClosedCallback cCb, BuffersEmptyCallback eCb, IdleCallback iCb) : - DispatchHandle(s, + DispatchHandle((const IOHandle&)s, boost::bind(&AsynchIO::readable, this, _1), boost::bind(&AsynchIO::writeable, this, _1), boost::bind(&AsynchIO::disconnected, this, _1)), diff --git a/qpid/cpp/src/qpid/sys/posix/Thread.cpp b/qpid/cpp/src/qpid/sys/posix/Thread.cpp index 2075e1dfbc..349e35d643 100644 --- a/qpid/cpp/src/qpid/sys/posix/Thread.cpp +++ b/qpid/cpp/src/qpid/sys/posix/Thread.cpp @@ -59,7 +59,7 @@ Thread::operator bool() { } bool Thread::operator==(const Thread& t) const { - return ::pthread_equal(impl->thread, t.impl->thread) != 0; + return pthread_equal(impl->thread, t.impl->thread) != 0; } bool Thread::operator!=(const Thread& t) const { diff --git a/qpid/cpp/src/qpid/sys/posix/Time.cpp b/qpid/cpp/src/qpid/sys/posix/Time.cpp index c44640b3e0..10a5d944b1 100644 --- a/qpid/cpp/src/qpid/sys/posix/Time.cpp +++ b/qpid/cpp/src/qpid/sys/posix/Time.cpp @@ -24,6 +24,7 @@ #include "qpid/sys/Time.h" #include <ostream> #include <istream> +#include <sstream> #include <time.h> #include <stdio.h> #include <sys/time.h> @@ -106,13 +107,14 @@ std::istream& operator>>(std::istream& i, Duration& d) { if (i.eof() || std::isspace(i.peek())) // No suffix d = int64_t(number*TIME_SEC); else { - std::string suffix; - i >> suffix; + std::stringbuf suffix; + i >> &suffix; if (i.fail()) return i; - if (suffix.compare("s") == 0) d = int64_t(number*TIME_SEC); - else if (suffix.compare("ms") == 0) d = int64_t(number*TIME_MSEC); - else if (suffix.compare("us") == 0) d = int64_t(number*TIME_USEC); - else if (suffix.compare("ns") == 0) d = int64_t(number*TIME_NSEC); + std::string suffix_str = suffix.str(); + if (suffix_str.compare("s") == 0) d = int64_t(number*TIME_SEC); + else if (suffix_str.compare("ms") == 0) d = int64_t(number*TIME_MSEC); + else if (suffix_str.compare("us") == 0) d = int64_t(number*TIME_USEC); + else if (suffix_str.compare("ns") == 0) d = int64_t(number*TIME_NSEC); else i.setstate(std::ios::failbit); } return i; diff --git a/qpid/cpp/src/qpid/sys/unordered_map.h b/qpid/cpp/src/qpid/sys/unordered_map.h index 22cedad299..1b27770804 100644 --- a/qpid/cpp/src/qpid/sys/unordered_map.h +++ b/qpid/cpp/src/qpid/sys/unordered_map.h @@ -23,7 +23,7 @@ #if defined(_MSC_VER) || defined(_LIBCPP_VERSION) || __cplusplus >= 201103L # include <unordered_map> -#elif defined(__SUNPRO_CC) +#elif defined(__SUNPRO_CC) || defined(__IBMCPP__) # include <boost/tr1/unordered_map.hpp> #else # include <tr1/unordered_map> diff --git a/qpid/cpp/src/qpid/types/Variant.cpp b/qpid/cpp/src/qpid/types/Variant.cpp index f9820a82dd..6b979a016b 100644 --- a/qpid/cpp/src/qpid/types/Variant.cpp +++ b/qpid/cpp/src/qpid/types/Variant.cpp @@ -188,13 +188,13 @@ bool caseInsensitiveMatch(const std::string& a, const std::string& b) return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin(), &same_char); } -const std::string TRUE("True"); -const std::string FALSE("False"); +const std::string TRUE_STRING("True"); +const std::string FALSE_STRING("False"); bool toBool(const std::string& s) { - if (caseInsensitiveMatch(s, TRUE)) return true; - if (caseInsensitiveMatch(s, FALSE)) return false; + if (caseInsensitiveMatch(s, TRUE_STRING)) return true; + if (caseInsensitiveMatch(s, FALSE_STRING)) return false; try { return boost::lexical_cast<int>(s); } catch(const boost::bad_lexical_cast&) {} throw InvalidConversion(QPID_MSG("Cannot convert " << s << " to bool")); } @@ -494,7 +494,7 @@ std::string VariantImpl::asString() const { switch(type) { case VAR_VOID: return EMPTY; - case VAR_BOOL: return value.b ? TRUE : FALSE; + case VAR_BOOL: return value.b ? TRUE_STRING : FALSE_STRING; case VAR_UINT8: return boost::lexical_cast<std::string>((int) value.ui8); case VAR_UINT16: return boost::lexical_cast<std::string>(value.ui16); case VAR_UINT32: return boost::lexical_cast<std::string>(value.ui32); diff --git a/qpid/cpp/src/tests/TimerTest.cpp b/qpid/cpp/src/tests/TimerTest.cpp index e9ca3fcdf6..d28eeeffc1 100644 --- a/qpid/cpp/src/tests/TimerTest.cpp +++ b/qpid/cpp/src/tests/TimerTest.cpp @@ -82,7 +82,7 @@ class TestTask : public TimerTask uint64_t difference = _abs64(expected - actual); #elif defined(_WIN32) uint64_t difference = labs(expected - actual); -#elif defined(__SUNPRO_CC) +#elif defined(__SUNPRO_CC) || defined (__IBMCPP__) uint64_t difference = llabs(expected - actual); #else uint64_t difference = abs(expected - actual); |
