diff options
| author | Stephen D. Huston <shuston@apache.org> | 2008-10-30 23:12:22 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2008-10-30 23:12:22 +0000 |
| commit | 962869a1b3e33711a831a46442a2af5b069f92e9 (patch) | |
| tree | 8a225197d5cac7f2b902b4fdb9e33daa57f69fb1 /cpp/src/qpid/management/ManagementObject.cpp | |
| parent | e08ee65d4d580187496683b57f90f7377c621b23 (diff) | |
| download | qpid-python-962869a1b3e33711a831a46442a2af5b069f92e9.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/management/ManagementObject.cpp')
| -rw-r--r-- | cpp/src/qpid/management/ManagementObject.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
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 <stdlib.h> + +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; |
