summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Allan Jansen <cliffjansen@apache.org>2012-06-17 23:57:36 +0000
committerClifford Allan Jansen <cliffjansen@apache.org>2012-06-17 23:57:36 +0000
commit25d7d586120db9696447be07d3aa9d80606f181b (patch)
treed5abd1922a82f276cf8c65b8595a88b6333650e9
parent4d4dcd7558a7efc6fbca626f8e5195e6d7f858a2 (diff)
downloadqpid-python-25d7d586120db9696447be07d3aa9d80606f181b.tar.gz
QPID-4071: basic porting changes for solaris native compiler
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1351185 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/managementgen/qmfgen/templates/Class.cpp1
-rw-r--r--qpid/cpp/src/CMakeLists.txt8
-rw-r--r--qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp2
-rw-r--r--qpid/cpp/src/qpid/console/ClassKey.cpp1
-rw-r--r--qpid/cpp/src/qpid/framing/FieldTable.cpp2
-rw-r--r--qpid/cpp/src/qpid/framing/Uuid.cpp2
-rw-r--r--qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp1
-rw-r--r--qpid/cpp/src/qpid/sys/unordered_map.h2
-rw-r--r--qpid/cpp/src/tests/FieldTable.cpp1
-rw-r--r--qpid/cpp/src/tests/TimerTest.cpp2
10 files changed, 18 insertions, 4 deletions
diff --git a/qpid/cpp/managementgen/qmfgen/templates/Class.cpp b/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
index fc0b9c8177..396812f2e0 100644
--- a/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
+++ b/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
@@ -29,6 +29,7 @@
/*MGEN:Class.MethodArgIncludes*/
#include <iostream>
#include <sstream>
+#include <string.h>
using namespace qmf::/*MGEN:Class.Namespace*/;
using qpid::management::ManagementAgent;
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index e7090b74a0..9791c391fe 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -281,7 +281,7 @@ endif (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
set (COMPILER_FLAGS "-library=stlport4 -mt")
- set (WARNING_FLAGS "+w2")
+ set (WARNING_FLAGS "+w")
endif (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
option(ENABLE_WARNINGS "Enable lots of compiler warnings (recommended)" ON)
@@ -826,6 +826,12 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
)
endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
+ # -lmalloc needed for mallinfo.
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lmalloc")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lmalloc")
+ endif (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
+
set (qpidtypes_platform_SOURCES)
set (qpidtypes_platform_LIBS
uuid
diff --git a/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp b/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
index 2ea4dc0c61..aaebec0720 100644
--- a/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
+++ b/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
@@ -78,7 +78,7 @@ bool expired(const sys::AbsTime& start, double timeout)
if (timeout == 0) return true;
if (timeout == FOREVER) return false;
sys::Duration used(start, sys::now());
- sys::Duration allowed(int64_t(timeout*sys::TIME_SEC));
+ sys::Duration allowed((int64_t)(timeout*sys::TIME_SEC));
return allowed < used;
}
diff --git a/qpid/cpp/src/qpid/console/ClassKey.cpp b/qpid/cpp/src/qpid/console/ClassKey.cpp
index 7a16113bae..d4b59fc413 100644
--- a/qpid/cpp/src/qpid/console/ClassKey.cpp
+++ b/qpid/cpp/src/qpid/console/ClassKey.cpp
@@ -21,6 +21,7 @@
#include "qpid/console/ClassKey.h"
#include <string.h>
+#include <iostream>
#include <cstdio>
using namespace std;
diff --git a/qpid/cpp/src/qpid/framing/FieldTable.cpp b/qpid/cpp/src/qpid/framing/FieldTable.cpp
index 0f7140b627..cd38db1ee8 100644
--- a/qpid/cpp/src/qpid/framing/FieldTable.cpp
+++ b/qpid/cpp/src/qpid/framing/FieldTable.cpp
@@ -196,7 +196,7 @@ void FieldTable::setFloat(const std::string& name, const float value){
flushRawCache();
}
-void FieldTable::setDouble(const std::string& name, double value){
+void FieldTable::setDouble(const std::string& name, const double value){
realDecode();
values[name] = ValuePtr(new DoubleValue(value));
flushRawCache();
diff --git a/qpid/cpp/src/qpid/framing/Uuid.cpp b/qpid/cpp/src/qpid/framing/Uuid.cpp
index e94e28ffee..e377c1172d 100644
--- a/qpid/cpp/src/qpid/framing/Uuid.cpp
+++ b/qpid/cpp/src/qpid/framing/Uuid.cpp
@@ -46,7 +46,7 @@ Uuid::Uuid(const uint8_t* data) {
Uuid::Uuid(const std::string& s) {
if (s.size() != UNPARSED_SIZE)
throw IllegalArgumentException(QPID_MSG("Invalid UUID: " << s));
- if (uuid_parse(&s[0], c_array()) != 0)
+ if (uuid_parse(const_cast<char *>(&s[0]), c_array()) != 0)
throw IllegalArgumentException(QPID_MSG("Invalid UUID: " << s));
}
diff --git a/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp b/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
index 249b769051..29b91f3e7a 100644
--- a/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
+++ b/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
@@ -18,6 +18,7 @@
* under the License.
*
*/
+#include <unistd.h>
#include "qpid/sys/cyrus/CyrusSecurityLayer.h"
#include <algorithm>
#include "qpid/framing/reply_exceptions.h"
diff --git a/qpid/cpp/src/qpid/sys/unordered_map.h b/qpid/cpp/src/qpid/sys/unordered_map.h
index 5f7f9567c5..7ae71c3daa 100644
--- a/qpid/cpp/src/qpid/sys/unordered_map.h
+++ b/qpid/cpp/src/qpid/sys/unordered_map.h
@@ -23,6 +23,8 @@
#ifdef _MSC_VER
# include <unordered_map>
+#elif defined(__SUNPRO_CC)
+# include <boost/tr1/unordered_map.hpp>
#else
# include <tr1/unordered_map>
#endif /* _MSC_VER */
diff --git a/qpid/cpp/src/tests/FieldTable.cpp b/qpid/cpp/src/tests/FieldTable.cpp
index 81372d87c5..8aeeb031b3 100644
--- a/qpid/cpp/src/tests/FieldTable.cpp
+++ b/qpid/cpp/src/tests/FieldTable.cpp
@@ -20,6 +20,7 @@
*/
#include <iostream>
#include <algorithm>
+#include "qpid/sys/alloca.h"
#include "qpid/framing/Array.h"
#include "qpid/framing/FieldTable.h"
#include "qpid/framing/FieldValue.h"
diff --git a/qpid/cpp/src/tests/TimerTest.cpp b/qpid/cpp/src/tests/TimerTest.cpp
index 6a0a196f4e..fc5004dcb0 100644
--- a/qpid/cpp/src/tests/TimerTest.cpp
+++ b/qpid/cpp/src/tests/TimerTest.cpp
@@ -81,6 +81,8 @@ class TestTask : public TimerTask
uint64_t difference = _abs64(expected - actual);
#elif defined(_WIN32)
uint64_t difference = labs(expected - actual);
+#elif defined(__SUNPRO_CC)
+ uint64_t difference = llabs(expected - actual);
#else
uint64_t difference = abs(expected - actual);
#endif