From 1d1182efd24d679fa12bc9525e4a7ea87f720e97 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 9 Jun 2017 17:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81gcc4.7~gcc4.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpClientImp.cpp | 12 ++++++------ src/Http/HttpClientImp.h | 4 ++-- src/Http/HttpsSession.h | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Http/HttpClientImp.cpp b/src/Http/HttpClientImp.cpp index 2a6f2172..b8c6dd84 100644 --- a/src/Http/HttpClientImp.cpp +++ b/src/Http/HttpClientImp.cpp @@ -27,19 +27,19 @@ void HttpClientImp::sendRequest(const string& url) { #else _sslBox.reset(new SSL_Box(false)); _sslBox->setOnDecData([this](const char *data, uint32_t len){ -#ifdef ANDROID +#if defined(__GNUC__) && (__GNUC__ < 5) public_onRecvBytes(data,len); -#else//ANDROID +#else//defined(__GNUC__) && (__GNUC__ < 5) HttpClient::onRecvBytes(data,len); -#endif//ANDROID +#endif//defined(__GNUC__) && (__GNUC__ < 5) }); _sslBox->setOnEncData([this](const char *data, uint32_t len){ -#ifdef ANDROID +#if defined(__GNUC__) && (__GNUC__ < 5) public_send(data,len); -#else//ANDROID +#else//defined(__GNUC__) && (__GNUC__ < 5) HttpClient::send(data,len); -#endif//ANDROID +#endif//defined(__GNUC__) && (__GNUC__ < 5) }); #endif //ENABLE_OPENSSL diff --git a/src/Http/HttpClientImp.h b/src/Http/HttpClientImp.h index 962f7df8..b774c818 100644 --- a/src/Http/HttpClientImp.h +++ b/src/Http/HttpClientImp.h @@ -24,14 +24,14 @@ public: virtual ~HttpClientImp(); virtual void sendRequest(const string &url) override; -#ifdef ANDROID +#if defined(__GNUC__) && (__GNUC__ < 5) void public_onRecvBytes(const char *data,int len){ HttpClient::onRecvBytes(data,len); } void public_send(const char *data, uint32_t len){ HttpClient::send(data,len); } -#endif //ANDROID +#endif //defined(__GNUC__) && (__GNUC__ < 5) private: #ifdef ENABLE_OPENSSL virtual void onRecvBytes(const char *data,int size) override; diff --git a/src/Http/HttpsSession.h b/src/Http/HttpsSession.h index 80a28de4..7dcd2f54 100644 --- a/src/Http/HttpsSession.h +++ b/src/Http/HttpsSession.h @@ -22,18 +22,18 @@ public: HttpsSession(const std::shared_ptr &pTh, const Socket::Ptr &pSock): HttpSession(pTh,pSock){ m_sslBox.setOnEncData([&](const char *data, uint32_t len){ -#ifdef ANDROID +#if defined(__GNUC__) && (__GNUC__ < 5) public_send(data,len); -#else//ANDROID +#else//defined(__GNUC__) && (__GNUC__ < 5) HttpSession::send(data,len); -#endif//ANDROID +#endif//defined(__GNUC__) && (__GNUC__ < 5) }); m_sslBox.setOnDecData([&](const char *data, uint32_t len){ -#ifdef ANDROID +#if defined(__GNUC__) && (__GNUC__ < 5) public_onRecv(data,len); -#else//ANDROID +#else//defined(__GNUC__) && (__GNUC__ < 5) HttpSession::onRecv(data,len); -#endif//ANDROID +#endif//defined(__GNUC__) && (__GNUC__ < 5) }); } virtual ~HttpsSession(){ @@ -43,14 +43,14 @@ public: TimeTicker(); m_sslBox.onRecv(pBuf->data(), pBuf->size()); } -#ifdef ANDROID +#if defined(__GNUC__) && (__GNUC__ < 5) int public_send(const char *data, uint32_t len){ return HttpSession::send(data,len); } void public_onRecv(const char *data, uint32_t len){ HttpSession::onRecv(data,len); } -#endif//ANDROID +#endif//defined(__GNUC__) && (__GNUC__ < 5) private: virtual int send(const string &buf) override{ TimeTicker();