]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: remove C++ version 11+ macro checks
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 17 Apr 2017 21:24:33 +0000 (09:24 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 17 Apr 2017 21:24:33 +0000 (09:24 +1200)
This version of Squid requires a C++11 compiler, so the conditional will always be true

compat/types.h
src/acl/CertificateData.cc
src/acl/HttpHeaderData.cc
src/acl/NoteData.cc
src/acl/Tree.h
src/base/RefCount.h
src/sbuf/SBuf.h
src/tests/testHttp1Parser.cc
src/tests/testHttp1Parser.h

index 8149f6211b71a4190d21695aa306bb93ca5184c9..23fabc163f3042cde8597c53456552330938d81c 100644 (file)
@@ -58,7 +58,7 @@
 /*
  * Ensure that standard type limits are defined for use
  */
-#if __cplusplus >= 201103L
+#if __cplusplus
 #include <cstdint>
 #elif HAVE_STDINT_H
 #include <stdint.h>
index 65ef118b4c5ac117e0074f0cb5e7702ffcc18968..217032f11e0319b65fd1ecef153c5159360d79e5 100644 (file)
@@ -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;
 }
 
index 28a55ea6f4fe05ab20e919972d5abd0d31db472f..9f5820f8f54a8161691026cf06e33a88c1072e45 100644 (file)
@@ -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;
 }
 
index d7f1f41d8540083cd6bfbb48eea9323304794a4b..d29ae0d8ee21cad1c6062f746759b85e5dfeac04 100644 (file)
@@ -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;
 }
 
index d243354cc391142f9c71a0e12c984460d831c575..a554f26d88885178930e7e6b1ad8ab985e5cbe7f 100644 (file)
@@ -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;
index a3b2fd7fa5812a6878e75c6317ae17e4523fc12c..b811fe508f3e0bf04031844438bfe8fe3869a0d6 100644 (file)
@@ -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_; }
 
index 1cc4658e7ce41e6d4967942f2183163e27a5b3fc..733b4baf17139157d1ddf00feccb75f0bc093104 100644 (file)
@@ -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.
      *
index e5736d9e93854c6860f49584ba2cecabdd5191dc..beccdc6806f85f0145131f993999e1103d7609c4 100644 (file)
@@ -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 */
 
index fb312fb0f219f34431c8da9d6cdf82b030fd366a..1cad5f25a3ad84b2ea0213dc07ebd3a2f7614c1f 100644 (file)
@@ -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