geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject [2/2] geode-native git commit: GEODE-2602: Fixes C++11 issues with Solaris Studio 12.5.
Date Wed, 15 Mar 2017 18:24:59 GMT
GEODE-2602: Fixes C++11 issues with Solaris Studio 12.5.


Project: http://git-wip-us.apache.org/repos/asf/geode-native/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode-native/commit/d782efa7
Tree: http://git-wip-us.apache.org/repos/asf/geode-native/tree/d782efa7
Diff: http://git-wip-us.apache.org/repos/asf/geode-native/diff/d782efa7

Branch: refs/heads/feature/GEODE-2602
Commit: d782efa7dbf84f691738087e7c5ff41a297c9e67
Parents: 6f2952e
Author: Jacob Barrett <jbarrett@pivotal.io>
Authored: Tue Mar 7 10:36:35 2017 -0800
Committer: Jacob Barrett <jbarrett@pivotal.io>
Committed: Tue Mar 7 10:36:35 2017 -0800

----------------------------------------------------------------------
 src/cppcache/include/geode/geode_globals.hpp |  6 +++++-
 src/tests/cpp/fwklib/UDPIpc.cpp              |  4 ++--
 src/tests/cpp/fwklib/UDPIpc.hpp              | 16 ++++++++--------
 3 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode-native/blob/d782efa7/src/cppcache/include/geode/geode_globals.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/geode_globals.hpp b/src/cppcache/include/geode/geode_globals.hpp
index 95d62a5..e76c6d9 100644
--- a/src/cppcache/include/geode/geode_globals.hpp
+++ b/src/cppcache/include/geode/geode_globals.hpp
@@ -96,9 +96,13 @@
 #define __has_cpp_attribute(x) 0
 #endif
 
-#if __cplusplus >= 201402L && __has_cpp_attribute(deprecated)
+#if __cplusplus >= 201402L
+#if __has_cpp_attribute(deprecated)
 // C++14 standard deprecated attribute
 #define __DEPRECATED__(msg) [[deprecated(msg)]]
+#else
+#error "__has_cpp_attribute(deprecated)"
+#endif
 #elif defined(__GNUC__)
 // GCC style deprecated attribute
 #define __DEPRECATED__(msg) __attribute__((deprecated(msg)))

http://git-wip-us.apache.org/repos/asf/geode-native/blob/d782efa7/src/tests/cpp/fwklib/UDPIpc.cpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/fwklib/UDPIpc.cpp b/src/tests/cpp/fwklib/UDPIpc.cpp
index a5a7928..d3f9fc5 100644
--- a/src/tests/cpp/fwklib/UDPIpc.cpp
+++ b/src/tests/cpp/fwklib/UDPIpc.cpp
@@ -254,7 +254,7 @@ int32_t Receiver::doTask() {
 
 void Receiver::initialize() {
   int32_t tries = 100;
-  int32_t port = m_basePort;
+  uint16_t port = m_basePort;
   int32_t lockResult = m_mutex.tryacquire();
   int32_t result = -1;
   if (lockResult != -1) {  // The listener thread
@@ -358,7 +358,7 @@ void Responder::initialize() {
   int32_t result = -1;
   int32_t tries = 100;
   while ((result < 0) && (--tries > 0)) {
-    int32_t port = ++m_offset + 111 + m_basePort;
+    uint16_t port = ++m_offset + 111 + m_basePort;
     result = m_io->open(ACE_INET_Addr(port, "localhost"));
     if (result < 0) {
       FWKWARN("Server failed to open io, " << errno << ", on port " <<
port);

http://git-wip-us.apache.org/repos/asf/geode-native/blob/d782efa7/src/tests/cpp/fwklib/UDPIpc.hpp
----------------------------------------------------------------------
diff --git a/src/tests/cpp/fwklib/UDPIpc.hpp b/src/tests/cpp/fwklib/UDPIpc.hpp
index 68b9ad9..dc143d9 100644
--- a/src/tests/cpp/fwklib/UDPIpc.hpp
+++ b/src/tests/cpp/fwklib/UDPIpc.hpp
@@ -197,15 +197,15 @@ class UDPMessageQueues : public SharedTaskObject {
 class Receiver : public ServiceTask {
  private:
   ACE_TSS<ACE_SOCK_Dgram> m_io;
-  int32_t m_basePort;
+  uint16_t m_basePort;
   ACE_thread_t m_listener;
-  std::atomic<int32_t> m_offset;
+  std::atomic<uint16_t> m_offset;
   std::list<std::string> m_addrs;
   UDPMessageQueues* m_queues;
   ACE_Thread_Mutex m_mutex;
 
  public:
-  Receiver(UDPMessageQueues* shared, int32_t port)
+  Receiver(UDPMessageQueues* shared, uint16_t port)
       : ServiceTask(shared), m_basePort(port), m_listener(0), m_mutex() {
     m_queues = dynamic_cast<UDPMessageQueues*>(m_shared);
   }
@@ -224,12 +224,12 @@ class Receiver : public ServiceTask {
 class STReceiver : public ServiceTask {
  private:
   ACE_SOCK_Dgram m_io;
-  int32_t m_basePort;
+  uint16_t m_basePort;
   UDPMessageQueues* m_queues;
   std::string m_addr;
 
  public:
-  STReceiver(UDPMessageQueues* shared, int32_t port)
+  STReceiver(UDPMessageQueues* shared, uint16_t port)
       : ServiceTask(shared), m_basePort(port) {
     m_queues = dynamic_cast<UDPMessageQueues*>(m_shared);
   }
@@ -272,12 +272,12 @@ class Processor : public ServiceTask {
 class Responder : public ServiceTask {
  private:
   ACE_TSS<ACE_SOCK_Dgram> m_io;
-  int32_t m_basePort;
-  std::atomic<int32_t> m_offset;
+  uint16_t m_basePort;
+  std::atomic<uint16_t> m_offset;
   UDPMessageQueues* m_queues;
 
  public:
-  Responder(UDPMessageQueues* shared, int32_t port)
+  Responder(UDPMessageQueues* shared, uint16_t port)
       : ServiceTask(shared), m_basePort(port) {
     m_queues = dynamic_cast<UDPMessageQueues*>(m_shared);
   }


Mime
View raw message