From 962869a1b3e33711a831a46442a2af5b069f92e9 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Thu, 30 Oct 2008 23:12:22 +0000 Subject: Adjust namespace references to work with MSVC git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@709281 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/management/ManagementObject.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'cpp/src/qpid/management/ManagementObject.cpp') diff --git a/cpp/src/qpid/management/ManagementObject.cpp b/cpp/src/qpid/management/ManagementObject.cpp index 09abbeb0ca..5a40e3f619 100644 --- a/cpp/src/qpid/management/ManagementObject.cpp +++ b/cpp/src/qpid/management/ManagementObject.cpp @@ -23,10 +23,12 @@ #include "ManagementObject.h" #include "qpid/agent/ManagementAgent.h" #include "qpid/framing/FieldTable.h" +#include "qpid/sys/Thread.h" -using namespace qpid::framing; +#include + +using namespace qpid; using namespace qpid::management; -using namespace qpid::sys; void AgentAttachment::setBanks(uint32_t broker, uint32_t bank) { @@ -57,20 +59,24 @@ ObjectId::ObjectId(AgentAttachment* _agent, uint8_t flags, uint16_t seq, uint64_ ObjectId::ObjectId(std::istream& in) : agent(0) { - string text; + std::string text; in >> text; fromString(text); } -ObjectId::ObjectId(const string& text) : agent(0) +ObjectId::ObjectId(const std::string& text) : agent(0) { fromString(text); } -void ObjectId::fromString(const string& text) +void ObjectId::fromString(const std::string& text) { #define FIELDS 5 - string copy(text.c_str()); +#if defined (_WIN32) && !defined (atoll) +# define atoll(X) _atoi64(X) +#endif + + std::string copy(text.c_str()); char* cText; char* field[FIELDS]; bool atFieldStart = true; @@ -152,12 +158,12 @@ std::ostream& operator<<(std::ostream& out, const ObjectId& i) int ManagementObject::nextThreadIndex = 0; -void ManagementObject::writeTimestamps (Buffer& buf) +void ManagementObject::writeTimestamps (framing::Buffer& buf) { buf.putShortString (getPackageName ()); buf.putShortString (getClassName ()); buf.putBin128 (getMd5Sum ()); - buf.putLongLong (uint64_t (Duration (now ()))); + buf.putLongLong (uint64_t (sys::Duration (sys::now ()))); buf.putLongLong (createTime); buf.putLongLong (destroyTime); objectId.encode(buf); @@ -166,7 +172,7 @@ void ManagementObject::writeTimestamps (Buffer& buf) void ManagementObject::setReference(ObjectId) {} int ManagementObject::getThreadIndex() { - static __thread int thisIndex = -1; + static QPID_TSS int thisIndex = -1; if (thisIndex == -1) { sys::Mutex::ScopedLock mutex(accessLock); thisIndex = nextThreadIndex; -- cgit v1.2.1