From 8da2392961daf55549b57a8c576f66df206f2c69 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Tue, 5 May 2009 22:13:18 +0000 Subject: Hack around the namespace pollution in QPID-1737 Hack around simultaneous import and definition of ManagementAgent::Singleton in qpidbroker Make ACL plugin optional (default off on Windows currently) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@771989 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/CMakeLists.txt | 26 +++++++++++++++++--------- cpp/src/qpid/agent/QmfAgentImportExport.h | 2 +- cpp/src/qpid/sys/windows/Condition.h | 1 + cpp/src/qpid/sys/windows/Mutex.h | 1 + cpp/src/qpid/sys/windows/uuid.cpp | 5 +++++ cpp/src/qpid/sys/windows/uuid.h | 6 +----- 6 files changed, 26 insertions(+), 15 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index 90647bd49d..605c5b6e2c 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -228,20 +228,28 @@ if (BUILD_XML) endif (BUILD_XML) # Build the ACL plugin -set (acl_SOURCES - qpid/acl/Acl.cpp - qpid/acl/Acl.h - qpid/acl/AclData.cpp - qpid/acl/AclData.h - qpid/acl/AclPlugin.cpp - qpid/acl/AclReader.cpp - qpid/acl/AclReader.h - ) +set (acl_default ON) +# Like this until we fix exporting symbols from the generated management code +if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows) + set(acl_default OFF) +endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows) +option(BUILD_ACL "Build ACL enforcement broker plugin" ${acl_default}) +if (BUILD_ACL) + set (acl_SOURCES + qpid/acl/Acl.cpp + qpid/acl/Acl.h + qpid/acl/AclData.cpp + qpid/acl/AclData.h + qpid/acl/AclPlugin.cpp + qpid/acl/AclReader.cpp + qpid/acl/AclReader.h + ) add_library (acl MODULE ${acl_SOURCES}) target_link_libraries (acl qpidbroker) set_target_properties (acl PROPERTIES PREFIX "" LINK_FLAGS -Wl,--no-undefined) +endif (BUILD_ACL) # Check for optional cluster support requirements include (cluster.cmake) diff --git a/cpp/src/qpid/agent/QmfAgentImportExport.h b/cpp/src/qpid/agent/QmfAgentImportExport.h index 9eee4a18fd..e614e09d6d 100644 --- a/cpp/src/qpid/agent/QmfAgentImportExport.h +++ b/cpp/src/qpid/agent/QmfAgentImportExport.h @@ -20,7 +20,7 @@ * under the License. */ -#if defined(WIN32) && !defined(QPID_DECLARE_STATIC) +#if defined(WIN32) && !defined(QPID_DECLARE_STATIC) && !defined(qpidbroker_EXPORTS) #if defined(QMF_AGENT_EXPORT) || defined (qmfagent_EXPORTS) #define QMF_AGENT_EXTERN __declspec(dllexport) #else diff --git a/cpp/src/qpid/sys/windows/Condition.h b/cpp/src/qpid/sys/windows/Condition.h index 979fae9b0a..c31f7b4823 100755 --- a/cpp/src/qpid/sys/windows/Condition.h +++ b/cpp/src/qpid/sys/windows/Condition.h @@ -30,6 +30,7 @@ #include #include #include +#undef STATUS_INVALID_PARAMETER // Hack for windows.h namespace pollution namespace qpid { namespace sys { diff --git a/cpp/src/qpid/sys/windows/Mutex.h b/cpp/src/qpid/sys/windows/Mutex.h index 08de0712b9..b8d34de6d1 100755 --- a/cpp/src/qpid/sys/windows/Mutex.h +++ b/cpp/src/qpid/sys/windows/Mutex.h @@ -31,6 +31,7 @@ #include #include #include +#undef STATUS_INVALID_PARAMETER // Hack for windows.h namespace pollution namespace qpid { namespace sys { diff --git a/cpp/src/qpid/sys/windows/uuid.cpp b/cpp/src/qpid/sys/windows/uuid.cpp index 92f60e04b1..4d8184c703 100644 --- a/cpp/src/qpid/sys/windows/uuid.cpp +++ b/cpp/src/qpid/sys/windows/uuid.cpp @@ -19,6 +19,11 @@ * */ +#include +#ifdef uuid_t /* Done in rpcdce.h */ +# undef uuid_t +#endif + #include "uuid.h" #include diff --git a/cpp/src/qpid/sys/windows/uuid.h b/cpp/src/qpid/sys/windows/uuid.h index 7d003c3739..c79abe95c6 100644 --- a/cpp/src/qpid/sys/windows/uuid.h +++ b/cpp/src/qpid/sys/windows/uuid.h @@ -22,13 +22,9 @@ * */ -#include #include "qpid/CommonImportExport.h" - -#ifdef uuid_t /* Done in rpcdce.h */ -# undef uuid_t -#endif #include + namespace qpid { namespace sys { const size_t UuidSize = 16; }} typedef uint8_t uuid_t[qpid::sys::UuidSize]; -- cgit v1.2.1