summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2016-06-22 20:41:49 +0000
committerAlan Conway <aconway@apache.org>2016-06-22 20:41:49 +0000
commite1d9be1b3590c79a0b2a6b6ad4cd3e6a65877401 (patch)
treecde644dcbd8add2d60863e71bc9063604911fdb0
parentc3c3bc4016270dd75b4c6a1e6831408cd4a5d055 (diff)
downloadqpid-python-e1d9be1b3590c79a0b2a6b6ad4cd3e6a65877401.tar.gz
QPID-7306: Conditional compile mismatch in broker and common libs.
Removed _IN_QPID_BROKER compile definition: Inconsistently set for libqpidcommon (compiled .cpp files) and libqpidbroker (uses .h) files - The broker has a binary incompatible notion of what is in the library. It sort-of works by accident: - shared_ptr<T> only contains a T*, the mismatch is effectively doing reinterpret_cast<T*> - plain T* works for op->, but doesn't guarantee no concurrent deletes. - we create and destroy shared_ptr in libraries with _IN_QPID_BROKER set so we get cleanup, and no cores if we're lucky but there is limited protection from races. Was only used by management: - I think exposing non-shared ptr GetObject was a feature that never materialized, - if not we need a separate function or class for non-shared-ptr users. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1749781 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/CMakeLists.txt11
-rw-r--r--qpid/cpp/src/amqp.cmake3
-rw-r--r--qpid/cpp/src/legacystore.cmake2
-rw-r--r--qpid/cpp/src/linearstore.cmake1
-rw-r--r--qpid/cpp/src/qpid/management/Manageable.h4
-rw-r--r--qpid/cpp/src/qpid/management/ManagementObject.h6
-rw-r--r--qpid/cpp/src/qpid/store/CMakeLists.txt4
-rw-r--r--qpid/cpp/src/rdma.cmake1
-rw-r--r--qpid/cpp/src/tests/CMakeLists.txt2
9 files changed, 6 insertions, 28 deletions
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index 3b9bc472bc..ef203e53b6 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -491,8 +491,7 @@ if (BUILD_XML)
qpid/xml/XmlExchangePlugin.cpp)
target_link_libraries (xml xerces-c xqilla qpidbroker qpidcommon)
set_target_properties (xml PROPERTIES
- PREFIX ""
- COMPILE_DEFINITIONS _IN_QPID_BROKER)
+ PREFIX "")
install (TARGETS xml
DESTINATION ${QPIDD_MODULE_DIR}
COMPONENT ${QPID_COMPONENT_BROKER})
@@ -576,8 +575,7 @@ if (BUILD_HA)
qpidtypes qpidcommon qpidbroker qpidmessaging
${Boost_PROGRAM_OPTIONS_LIBRARY})
set_target_properties (ha PROPERTIES
- PREFIX ""
- COMPILE_DEFINITIONS _IN_QPID_BROKER)
+ PREFIX "")
install (TARGETS ha
DESTINATION ${QPIDD_MODULE_DIR}
COMPONENT ${QPID_COMPONENT_BROKER})
@@ -1139,8 +1137,8 @@ target_link_libraries (qpidbroker qpidcommon qpidtypes
set_target_properties (qpidbroker PROPERTIES
VERSION ${qpidbroker_version}
- SOVERSION ${qpidbroker_version_major}
- COMPILE_DEFINITIONS _IN_QPID_BROKER)
+ SOVERSION ${qpidbroker_version_major})
+
if (CMAKE_CXX_COMPILER_ID MATCHES XL)
set_target_properties (qpidbroker PROPERTIES LINK_FLAGS -Wl,-bbigtoc)
endif (CMAKE_CXX_COMPILER_ID MATCHES XL)
@@ -1163,7 +1161,6 @@ set (qpidd_SOURCES
add_msvc_version (qpidd application exe)
add_executable (qpidd ${qpidd_SOURCES})
target_link_libraries (qpidd qpidbroker qpidcommon)
-set_target_properties (qpidd PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
install (TARGETS qpidd
RUNTIME DESTINATION ${QPID_INSTALL_SBINDIR} COMPONENT ${QPID_COMPONENT_BROKER}
LIBRARY DESTINATION ${QPID_INSTALL_LIBDIR} COMPONENT ${QPID_COMPONENT_BROKER}
diff --git a/qpid/cpp/src/amqp.cmake b/qpid/cpp/src/amqp.cmake
index 9e2bf75ac4..ea36a92904 100644
--- a/qpid/cpp/src/amqp.cmake
+++ b/qpid/cpp/src/amqp.cmake
@@ -106,8 +106,7 @@ if (BUILD_AMQP)
add_library (amqp MODULE ${amqp_SOURCES})
target_link_libraries (amqp qpidtypes qpidbroker qpidcommon ${Proton_LIBRARIES})
set_target_properties (amqp PROPERTIES
- PREFIX ""
- COMPILE_DEFINITIONS _IN_QPID_BROKER)
+ PREFIX "")
install (TARGETS amqp
DESTINATION ${QPIDD_MODULE_DIR}
diff --git a/qpid/cpp/src/legacystore.cmake b/qpid/cpp/src/legacystore.cmake
index 3cb1171b00..ef5df28c41 100644
--- a/qpid/cpp/src/legacystore.cmake
+++ b/qpid/cpp/src/legacystore.cmake
@@ -115,7 +115,7 @@ if (BUILD_LEGACYSTORE)
qpid/legacystore/TxnCtxt.cpp
)
- set (legacystore_defines _IN_QPID_BROKER RHM_CLEAN)
+ set (legacystore_defines RHM_CLEAN)
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/db-inc.h)
message(STATUS "Including BDB from ${DB_CXX_INCLUDE_DIR}/db_cxx.h")
diff --git a/qpid/cpp/src/linearstore.cmake b/qpid/cpp/src/linearstore.cmake
index e876ca712a..8c90e8a1eb 100644
--- a/qpid/cpp/src/linearstore.cmake
+++ b/qpid/cpp/src/linearstore.cmake
@@ -150,7 +150,6 @@ if (BUILD_LINEARSTORE)
set_target_properties (linearstore PROPERTIES
PREFIX ""
- COMPILE_DEFINITIONS _IN_QPID_BROKER
OUTPUT_NAME linearstore
INCLUDE_DIRECTORIES "${linear_include_DIRECTORIES}"
)
diff --git a/qpid/cpp/src/qpid/management/Manageable.h b/qpid/cpp/src/qpid/management/Manageable.h
index ede5c29e43..70c9a5a188 100644
--- a/qpid/cpp/src/qpid/management/Manageable.h
+++ b/qpid/cpp/src/qpid/management/Manageable.h
@@ -55,11 +55,7 @@ class QPID_COMMON_EXTERN Manageable
//
// This accessor function returns a pointer to the management object.
//
-#ifdef _IN_QPID_BROKER
virtual ManagementObject::shared_ptr GetManagementObject() const = 0;
-#else
- virtual ManagementObject* GetManagementObject() const = 0;
-#endif
// Every "Manageable" object must implement ManagementMethod. This
// function is called when a remote management client invokes a method
diff --git a/qpid/cpp/src/qpid/management/ManagementObject.h b/qpid/cpp/src/qpid/management/ManagementObject.h
index 93fbec7bc7..5719c2354d 100644
--- a/qpid/cpp/src/qpid/management/ManagementObject.h
+++ b/qpid/cpp/src/qpid/management/ManagementObject.h
@@ -28,9 +28,7 @@
#include <map>
#include <vector>
-#ifdef _IN_QPID_BROKER
#include <boost/shared_ptr.hpp>
-#endif
namespace qpid {
namespace management {
@@ -158,9 +156,7 @@ protected:
QPID_COMMON_EXTERN uint32_t writeTimestampsSize() const;
public:
-#ifdef _IN_QPID_BROKER
typedef boost::shared_ptr<ManagementObject> shared_ptr;
-#endif
QPID_COMMON_EXTERN static const uint8_t MD5_LEN = 16;
QPID_COMMON_EXTERN static int maxThreads;
@@ -234,10 +230,8 @@ protected:
//QPID_COMMON_EXTERN void mapDecode(const types::Variant::Map& map);
};
-#ifdef _IN_QPID_BROKER
typedef std::map<ObjectId, ManagementObject::shared_ptr> ManagementObjectMap;
typedef std::vector<ManagementObject::shared_ptr> ManagementObjectVector;
-#endif
}}
diff --git a/qpid/cpp/src/qpid/store/CMakeLists.txt b/qpid/cpp/src/qpid/store/CMakeLists.txt
index ee7894730a..ec1fa16e7b 100644
--- a/qpid/cpp/src/qpid/store/CMakeLists.txt
+++ b/qpid/cpp/src/qpid/store/CMakeLists.txt
@@ -40,7 +40,6 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties (store PROPERTIES
PREFIX ""
- COMPILE_DEFINITIONS _IN_QPID_BROKER
LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
@@ -54,7 +53,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows)
endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
set_target_properties (store PROPERTIES
- COMPILE_DEFINITIONS _IN_QPID_BROKER
VERSION ${qpidc_version})
install (TARGETS store # RUNTIME
DESTINATION ${QPIDD_MODULE_DIR}
@@ -82,7 +80,6 @@ if (BUILD_MSSQL)
ms-sql/State.cpp
ms-sql/TplRecordset.cpp
ms-sql/VariantHelper.cpp)
- set_target_properties (mssql_store PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
target_link_libraries (mssql_store qpidbroker qpidcommon)
install (TARGETS mssql_store # RUNTIME
DESTINATION ${QPIDD_MODULE_DIR}
@@ -112,7 +109,6 @@ if (BUILD_MSCLFS)
ms-sql/State.cpp
ms-sql/VariantHelper.cpp)
include_directories(ms-sql)
- set_target_properties (msclfs_store PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
target_link_libraries (msclfs_store qpidbroker qpidcommon clfsw32.lib)
install (TARGETS msclfs_store # RUNTIME
DESTINATION ${QPIDD_MODULE_DIR}
diff --git a/qpid/cpp/src/rdma.cmake b/qpid/cpp/src/rdma.cmake
index 9db06269af..07fac5cdc8 100644
--- a/qpid/cpp/src/rdma.cmake
+++ b/qpid/cpp/src/rdma.cmake
@@ -79,7 +79,6 @@ if (BUILD_RDMA)
add_library (rdma MODULE qpid/sys/RdmaIOPlugin.cpp)
target_link_libraries (rdma qpidbroker qpidcommon rdmawrap)
set_target_properties (rdma PROPERTIES
- COMPILE_DEFINITIONS _IN_QPID_BROKER
PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt
index 930d8b7fb7..d69d2874c4 100644
--- a/qpid/cpp/src/tests/CMakeLists.txt
+++ b/qpid/cpp/src/tests/CMakeLists.txt
@@ -214,7 +214,6 @@ add_executable (unit_test unit_test
target_link_libraries (unit_test
${qpid_test_boost_libs}
qpidmessaging qpidtypes qpidbroker qpidclient qpidcommon)
-set_target_properties (unit_test PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
endif (BUILD_TESTING_UNITTESTS)
@@ -306,7 +305,6 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
# Posix-only tests
add_test(NAME ha_tests COMMAND ${PYTHON_EXECUTABLE} run_ha_tests)
-
add_test(NAME ipv6_tests COMMAND run_ipv6_tests) # Also pretty simple to convert
add_test(NAME logging_tests COMMAND run_logging_tests) # Pretty simple to convert
add_test(NAME paged_queue_tests COMMAND run_paged_queue_tests)