From 522cbab23d26a495131821a554eedf02573f514e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 24 Jan 2018 10:55:16 +0200 Subject: [PATCH] Make the CDC connector C++0x compliant As CentOS 6 is supported, the CDC connector ought to build on non-C++11 systems. --- connectors/cdc-connector/cdc_connector.cpp | 11 ++++++----- connectors/cdc-connector/cdc_connector.h | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/connectors/cdc-connector/cdc_connector.cpp b/connectors/cdc-connector/cdc_connector.cpp index 6cf166fca..fa9628f70 100644 --- a/connectors/cdc-connector/cdc_connector.cpp +++ b/connectors/cdc-connector/cdc_connector.cpp @@ -120,7 +120,8 @@ template class Closer public: Closer(T t): - m_t(t) + m_t(t), + m_close(false) { } @@ -147,9 +148,9 @@ public: private: T m_t; - bool m_close = true; + bool m_close; - void close(T t) = delete; + void close(T t); }; template <> void Closer::close(struct addrinfo* ai) @@ -314,8 +315,8 @@ static inline bool is_schema(json_t* json) void Connection::process_schema(json_t* json) { - SValueVector keys(std::make_shared()); - SValueVector types(std::make_shared()); + SValueVector keys(new ValueVector); + SValueVector types(new ValueVector); json_t* arr = json_object_get(json, "fields"); size_t i; diff --git a/connectors/cdc-connector/cdc_connector.h b/connectors/cdc-connector/cdc_connector.h index ce2e0784b..fa01ac28b 100644 --- a/connectors/cdc-connector/cdc_connector.h +++ b/connectors/cdc-connector/cdc_connector.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -34,10 +34,10 @@ const char* TIMEOUT = "Request timed out"; // The typedef for the Row type class Row; -typedef std::shared_ptr SRow; +typedef std::tr1::shared_ptr SRow; typedef std::vector ValueVector; -typedef std::shared_ptr SValueVector; +typedef std::tr1::shared_ptr SValueVector; typedef std::map ValueMap; // A class that represents a CDC connection