THRIFT-2367 Build failure: stdlib and boost both define uint64_t
authorRoger Meier <roger@apache.org>
Wed, 19 Feb 2014 15:28:35 +0000 (16:28 +0100)
committerRoger Meier <roger@apache.org>
Wed, 19 Feb 2014 15:28:35 +0000 (16:28 +0100)
Fix: remove "using namespace boost;"
Patch: Roger Meier

lib/cpp/src/thrift/transport/TSSLServerSocket.cpp
lib/cpp/src/thrift/transport/TSSLSocket.cpp
tutorial/cpp/CppClient.cpp
tutorial/cpp/CppServer.cpp

index e7a0d74..45301f8 100644 (file)
 
 namespace apache { namespace thrift { namespace transport {
 
-using namespace boost;
-
 /**
  * SSL server socket implementation.
  */
 TSSLServerSocket::TSSLServerSocket(THRIFT_SOCKET port,
-                                   shared_ptr<TSSLSocketFactory> factory):
+                                   boost::shared_ptr<TSSLSocketFactory> factory):
                                    TServerSocket(port), factory_(factory) {
   factory_->server(true);
 }
 
 TSSLServerSocket::TSSLServerSocket(int port, int sendTimeout, int recvTimeout,
-                                   shared_ptr<TSSLSocketFactory> factory):
+                                   boost::shared_ptr<TSSLSocketFactory> factory):
                                    TServerSocket(port, sendTimeout, recvTimeout),
                                    factory_(factory) {
   factory_->server(true);
 }
 
-shared_ptr<TSocket> TSSLServerSocket::createSocket(THRIFT_SOCKET client) {
+boost::shared_ptr<TSocket> TSSLServerSocket::createSocket(THRIFT_SOCKET client) {
   return factory_->createSocket(client);
 }
 
index 57b530f..ce971d3 100644 (file)
@@ -41,7 +41,6 @@
 #define OPENSSL_VERSION_NO_THREAD_ID 0x10000000L
 
 using namespace std;
-using namespace boost;
 using namespace apache::thrift::concurrency;
 
 struct CRYPTO_dynlock_value {
@@ -490,7 +489,7 @@ int TSSLSocketFactory::passwordCallback(char* password,
   return length;
 }
 
-static shared_array<Mutex> mutexes;
+static boost::shared_array<Mutex> mutexes;
 
 static void callbackLocking(int mode, int n, const char*, int) {
   if (mode & CRYPTO_LOCK) {
@@ -534,7 +533,7 @@ void TSSLSocketFactory::initializeOpenSSL() {
   SSL_library_init();
   SSL_load_error_strings();
   // static locking
-  mutexes = shared_array<Mutex>(new Mutex[::CRYPTO_num_locks()]);
+  mutexes = boost::shared_array<Mutex>(new Mutex[::CRYPTO_num_locks()]);
   if (mutexes == NULL) {
     throw TTransportException(TTransportException::INTERNAL_ERROR,
           "initializeOpenSSL() failed, "
@@ -592,7 +591,7 @@ void buildErrors(string& errors, int errno_copy) {
     }
   }
   if (errors.empty()) {
-    errors = "error code: " + lexical_cast<string>(errno_copy);
+    errors = "error code: " + boost::lexical_cast<string>(errno_copy);
   }
 }
 
index b91df2e..4218019 100644 (file)
@@ -35,8 +35,6 @@ using namespace apache::thrift::transport;
 using namespace tutorial;
 using namespace shared;
 
-using namespace boost;
-
 int main(int argc, char** argv) {
   boost::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
   boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
index f19258c..d75b553 100644 (file)
@@ -41,8 +41,6 @@ using namespace apache::thrift::server;
 using namespace tutorial;
 using namespace shared;
 
-using namespace boost;
-
 class CalculatorHandler : public CalculatorIf {
  public:
   CalculatorHandler() {}