Author: chug
Date: Thu Aug 4 20:17:09 2011
New Revision: 1153993
URL: http://svn.apache.org/viewvc?rev=1153993&view=rev
Log:
QPID-2643 Building QPID with Visual Studio 2010
This patch changes:
List.h - add a typedef from the original post
IntegerTypes.h - adds 'signed' to int_8 to avoid MSVC complaint
SessionState.cpp, qpid-perftest.cpp - adds explicit boost:: to disambiguate
methods recently defined by 'using std'.
CMakeLists.txt -
Adds a CMake option that allows user to include '#define
_WIN32_WINNT=0x0502' or not.
Linux users see no change.
This replaces CMake code that includes a similar definition when the build
system _has VS2005 installed_.
Even if the Generator is VS2010 the def was added because VS2005 is
installed. This in not right.
Without this definition several components define _WIN32_WINNT=0x0501 to
target network and system api components.
Those components will still work correctly with 0x0502.
Defining _WIN32_WINNT=0x0501 across the board causes a build error in
cpp\qpid\store that 0x0502 avoids.
This patch will move the minimum required version of Windows from WinXP to
WinXP-SP3.
Modified:
qpid/trunk/qpid/cpp/include/qpid/framing/List.h
qpid/trunk/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h
qpid/trunk/qpid/cpp/src/CMakeLists.txt
qpid/trunk/qpid/cpp/src/tests/SessionState.cpp
qpid/trunk/qpid/cpp/src/tests/qpid-perftest.cpp
Modified: qpid/trunk/qpid/cpp/include/qpid/framing/List.h
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/framing/List.h?rev=1153993&r1=1153992&r2=1153993&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/framing/List.h (original)
+++ qpid/trunk/qpid/cpp/include/qpid/framing/List.h Thu Aug 4 20:17:09 2011
@@ -40,6 +40,7 @@ class QPID_COMMON_CLASS_EXTERN List
{
public:
typedef boost::shared_ptr<FieldValue> ValuePtr;
+ typedef ValuePtr value_type;
typedef std::list<ValuePtr> Values;
typedef Values::const_iterator const_iterator;
typedef Values::iterator iterator;
Modified: qpid/trunk/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h?rev=1153993&r1=1153992&r2=1153993&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h (original)
+++ qpid/trunk/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h Thu Aug 4
20:17:09 2011
@@ -27,7 +27,7 @@ typedef short int16_t;
typedef unsigned int uint32_t;
typedef int int32_t;
#if defined(_MSC_VER)
-typedef char int8_t;
+typedef signed char int8_t;
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
#else
Modified: qpid/trunk/qpid/cpp/src/CMakeLists.txt
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/CMakeLists.txt?rev=1153993&r1=1153992&r2=1153993&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/CMakeLists.txt Thu Aug 4 20:17:09 2011
@@ -580,6 +580,15 @@ include (ssl.cmake)
check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV)
check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP)
+# Allow MSVC user to select 'WinXP-SP3/Windows Server 2003' as build target
version
+set (win32_winnt_default OFF)
+if (CMAKE_SYSTEM_NAME STREQUAL Windows)
+ if (MSVC)
+ set (win32_winnt_default ON)
+ endif (MSVC)
+endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
+option(SET_WIN32_WINNT "In Windows-MSVC build: define _WIN32_WINNT=0x0502 to
select target version: Windows XP with SP3" ${win32_winnt_default})
+
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
if (MSVC)
add_definitions(
@@ -590,9 +599,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows)
/wd4800
/wd4355
)
- if (MSVC80)
- add_definitions(/D "_WIN32_WINNT=0x0501")
- endif (MSVC80)
+ if (SET_WIN32_WINNT)
+ add_definitions(/D "_WIN32_WINNT=0x0502")
+ endif (SET_WIN32_WINNT)
# set the RelWithDebInfo compile/link switches to equal Release
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob2 /D NDEBUG")
Modified: qpid/trunk/qpid/cpp/src/tests/SessionState.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/SessionState.cpp?rev=1153993&r1=1153992&r2=1153993&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/SessionState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/SessionState.cpp Thu Aug 4 20:17:09 2011
@@ -43,7 +43,7 @@ using namespace qpid::framing;
// Apply f to [begin, end) and accumulate the result
template <class Iter, class T, class F>
T applyAccumulate(Iter begin, Iter end, T seed, const F& f) {
- return std::accumulate(begin, end, seed, bind(std::plus<T>(), _1, bind(f,
_2)));
+ return std::accumulate(begin, end, seed, boost::bind(std::plus<T>(), _1,
boost::bind(f, _2)));
}
// Create a frame with a one-char string.
@@ -105,8 +105,8 @@ size_t transferN(qpid::SessionState& s,
char last = content[content.size()-1];
content.resize(content.size()-1);
size += applyAccumulate(content.begin(), content.end(), 0,
- bind(&send, ref(s),
- bind(contentFrameChar, _1, false)));
+ boost::bind(&send, boost::ref(s),
+ boost::bind(contentFrameChar, _1,
false)));
size += send(s, contentFrameChar(last, true));
}
return size;
@@ -115,7 +115,7 @@ size_t transferN(qpid::SessionState& s,
// Send multiple transfers with single-byte content.
size_t transfers(qpid::SessionState& s, string content) {
return applyAccumulate(content.begin(), content.end(), 0,
- bind(transfer1Char, ref(s), _1));
+ boost::bind(transfer1Char, boost::ref(s), _1));
}
size_t contentFrameSize(size_t n=1) { return AMQFrame((
AMQContentBody())).encodedSize() + n; }
Modified: qpid/trunk/qpid/cpp/src/tests/qpid-perftest.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpid-perftest.cpp?rev=1153993&r1=1153992&r2=1153993&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/qpid-perftest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/qpid-perftest.cpp Thu Aug 4 20:17:09 2011
@@ -396,7 +396,7 @@ struct Controller : public Client {
void run() { // Controller
try {
// Wait for subscribers to be ready.
- process(opts.totalSubs, fqn("sub_ready"), bind(expect, _1,
"ready"));
+ process(opts.totalSubs, fqn("sub_ready"), boost::bind(expect, _1,
"ready"));
LocalQueue pubDone;
LocalQueue subDone;
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]