From: Amos Jeffries Date: Mon, 17 Apr 2017 21:24:33 +0000 (+1200) Subject: Cleanup: remove C++ version 11+ macro checks X-Git-Tag: M-staged-PR71~193 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f1a74329261430a10473c332e4bc76bc22816d2;p=thirdparty%2Fsquid.git Cleanup: remove C++ version 11+ macro checks This version of Squid requires a C++11 compiler, so the conditional will always be true --- diff --git a/compat/types.h b/compat/types.h index 8149f6211b..23fabc163f 100644 --- a/compat/types.h +++ b/compat/types.h @@ -58,7 +58,7 @@ /* * Ensure that standard type limits are defined for use */ -#if __cplusplus >= 201103L +#if __cplusplus #include #elif HAVE_STDINT_H #include diff --git a/src/acl/CertificateData.cc b/src/acl/CertificateData.cc index 65ef118b4c..217032f11e 100644 --- a/src/acl/CertificateData.cc +++ b/src/acl/CertificateData.cc @@ -79,13 +79,7 @@ ACLCertificateData::dump() const if (validAttributesStr) sl.push_back(SBuf(attribute)); -#if __cplusplus >= 201103L sl.splice(sl.end(),values.dump()); -#else - // temp is needed until c++11 move constructor - SBufList tmp = values.dump(); - sl.splice(sl.end(),tmp); -#endif return sl; } diff --git a/src/acl/HttpHeaderData.cc b/src/acl/HttpHeaderData.cc index 28a55ea6f4..9f5820f8f5 100644 --- a/src/acl/HttpHeaderData.cc +++ b/src/acl/HttpHeaderData.cc @@ -61,13 +61,7 @@ ACLHTTPHeaderData::dump() const { SBufList sl; sl.push_back(SBuf(hdrName)); -#if __cplusplus >= 201103L sl.splice(sl.end(), regex_rule->dump()); -#else - // temp is needed until c++11 move-constructor - SBufList temp = regex_rule->dump(); - sl.splice(sl.end(), temp); -#endif return sl; } diff --git a/src/acl/NoteData.cc b/src/acl/NoteData.cc index d7f1f41d85..d29ae0d8ee 100644 --- a/src/acl/NoteData.cc +++ b/src/acl/NoteData.cc @@ -40,13 +40,7 @@ ACLNoteData::dump() const { SBufList sl; sl.push_back(name); -#if __cplusplus >= 201103L sl.splice(sl.end(), values->dump()); -#else - // temp is needed until c++11 move constructor - SBufList temp = values->dump(); - sl.splice(sl.end(), temp); -#endif return sl; } diff --git a/src/acl/Tree.h b/src/acl/Tree.h index d243354cc3..a554f26d88 100644 --- a/src/acl/Tree.h +++ b/src/acl/Tree.h @@ -73,13 +73,7 @@ Tree::treeDump(const char *prefix, ActionToStringConverter converter) const ++action; } -#if __cplusplus >= 201103L text.splice(text.end(), (*node)->dump()); -#else - // temp is needed until c++11 move constructor - SBufList temp = (*node)->dump(); - text.splice(text.end(), temp); -#endif text.push_back(SBuf("\n")); } return text; diff --git a/src/base/RefCount.h b/src/base/RefCount.h index a3b2fd7fa5..b811fe508f 100644 --- a/src/base/RefCount.h +++ b/src/base/RefCount.h @@ -39,11 +39,9 @@ public: reference (p); } -#if __cplusplus >= 201103L RefCount (RefCount &&p) : p_(std::move(p.p_)) { p.p_=NULL; } -#endif RefCount& operator = (const RefCount& p) { // DO NOT CHANGE THE ORDER HERE!!! @@ -54,7 +52,6 @@ public: return *this; } -#if __cplusplus >= 201103L RefCount& operator = (RefCount&& p) { if (this != &p) { dereference(p.p_); @@ -62,7 +59,6 @@ public: } return *this; } -#endif explicit operator bool() const { return p_; } diff --git a/src/sbuf/SBuf.h b/src/sbuf/SBuf.h index 1cc4658e7c..733b4baf17 100644 --- a/src/sbuf/SBuf.h +++ b/src/sbuf/SBuf.h @@ -133,7 +133,6 @@ public: * Current SBuf will share backing store with the assigned one. */ SBuf& operator =(const SBuf & S) {return assign(S);} -#if __cplusplus >= 201103L SBuf& operator =(SBuf &&S) { ++stats.moves; if (this != &S) { @@ -146,7 +145,6 @@ public: } return *this; } -#endif /** Import a c-string into a SBuf, copying the data. * diff --git a/src/tests/testHttp1Parser.cc b/src/tests/testHttp1Parser.cc index e5736d9e93..beccdc6806 100644 --- a/src/tests/testHttp1Parser.cc +++ b/src/tests/testHttp1Parser.cc @@ -147,7 +147,6 @@ testHttp1Parser::testParserConstruct() } } -#if __cplusplus >= 201103L void testHttp1Parser::testParseRequestLineProtocols() { @@ -1184,5 +1183,4 @@ testHttp1Parser::testDripFeed() } while (Config.onoff.relaxed_header_parser); } -#endif /* __cplusplus >= 201103L */ diff --git a/src/tests/testHttp1Parser.h b/src/tests/testHttp1Parser.h index fb312fb0f2..1cad5f25a3 100644 --- a/src/tests/testHttp1Parser.h +++ b/src/tests/testHttp1Parser.h @@ -16,15 +16,12 @@ class testHttp1Parser : public CPPUNIT_NS::TestFixture CPPUNIT_TEST_SUITE( testHttp1Parser ); // object basics are working, just in case. CPPUNIT_TEST( testParserConstruct ); - -#if __cplusplus >= 201103L CPPUNIT_TEST( testDripFeed ); CPPUNIT_TEST( testParseRequestLineMethods ); CPPUNIT_TEST( testParseRequestLineProtocols ); CPPUNIT_TEST( testParseRequestLineTerminators ); CPPUNIT_TEST( testParseRequestLineStrange ); CPPUNIT_TEST( testParseRequestLineInvalid ); -#endif CPPUNIT_TEST_SUITE_END(); protected: @@ -32,7 +29,6 @@ protected: void testParserConstruct(); // whether the constructor works -#if __cplusplus >= 201103L // request-line unit tests void testParseRequestLineTerminators(); // terminator detection correct void testParseRequestLineMethods(); // methoid detection correct @@ -41,7 +37,6 @@ protected: void testParseRequestLineInvalid(); // rejection of invalid lines happens void testDripFeed(); // test incremental parse works -#endif }; #endif