From e8c59f2d3ca6fd1f686aa4dae109baab391dd024 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Fri, 13 Dec 2019 11:00:31 +0100 Subject: [PATCH] Replace include guard ifdef/define with pragma once --- modules/bindbackend/bindbackend2.hh | 7 +----- modules/geoipbackend/geoipbackend.hh | 6 +---- modules/geoipbackend/geoipinterface.hh | 6 +---- modules/gmysqlbackend/gmysqlbackend.hh | 6 +---- modules/gmysqlbackend/smysql.hh | 6 +---- modules/godbcbackend/godbcbackend.hh | 2 +- modules/godbcbackend/sodbc.hh | 7 +----- modules/gpgsqlbackend/gpgsqlbackend.hh | 6 +---- modules/gpgsqlbackend/spgsql.hh | 5 +---- modules/gsqlite3backend/gsqlite3backend.hh | 6 +---- modules/lua2backend/lua2api2.hh | 5 ----- modules/lua2backend/lua2backend.hh | 5 ----- modules/pipebackend/coprocess.hh | 5 +---- modules/pipebackend/pipebackend.hh | 9 +------- modules/remotebackend/remotebackend.hh | 4 +--- modules/tinydnsbackend/tinydnsbackend.hh | 6 +---- pdns/anadns.hh | 6 +---- pdns/arguments.hh | 6 +---- pdns/auth-caches.hh | 6 +---- pdns/auth-packetcache.hh | 6 +---- pdns/auth-querycache.hh | 6 +---- pdns/backends/gsql/gsqlbackend.hh | 6 +---- pdns/backends/gsql/ssql.hh | 6 +---- pdns/base32.hh | 5 +---- pdns/base64.hh | 6 +---- pdns/bindparserclasses.hh | 5 +---- pdns/cdb.hh | 6 +---- pdns/comment.hh | 6 +---- pdns/common_startup.hh | 6 +---- pdns/communicator.hh | 7 +----- pdns/distributor.hh | 7 +----- pdns/dns_random.hh | 5 +---- pdns/dnsbackend.hh | 5 +---- pdns/dnsdist-snmp.hh | 26 +++++++++++++++++----- pdns/dnspacket.hh | 7 +----- pdns/dnsparser.hh | 6 +---- pdns/dnspcap.hh | 6 +---- pdns/dnsproxy.hh | 5 +---- pdns/dnsrecords.hh | 5 +---- pdns/dnssecinfra.hh | 5 +---- pdns/dnswriter.hh | 6 ++--- pdns/doh.hh | 21 +++++++++++++++++ pdns/dynhandler.hh | 5 +---- pdns/dynlistener.hh | 5 +---- pdns/dynmessenger.hh | 6 +---- pdns/ednscookies.hh | 5 +---- pdns/ednsoptions.hh | 6 +---- pdns/ednssubnet.hh | 5 +---- pdns/gss_context.hh | 4 ---- pdns/iputils.hh | 6 +---- pdns/lazy_allocator.hh | 6 +---- pdns/lock.hh | 6 +---- pdns/lwres.hh | 4 +--- pdns/mplexer.hh | 7 +----- pdns/mtasker.hh | 6 +---- pdns/mtasker_context.hh | 7 +----- pdns/nameserver.hh | 6 +---- pdns/namespaces.hh | 5 +---- pdns/packetcache.hh | 6 +---- pdns/packethandler.hh | 5 +---- pdns/pdnsexception.hh | 7 +----- pdns/pkcs11signers.hh | 5 +---- pdns/qtype.hh | 5 +---- pdns/rcpgenerator.hh | 4 +--- pdns/rec-snmp.hh | 26 +++++++++++++++++----- pdns/recpacketcache.hh | 5 +---- pdns/recursor_cache.hh | 4 +--- pdns/resolver.hh | 7 +----- pdns/secpoll-auth.hh | 5 +---- pdns/secpoll-recursor.hh | 5 +---- pdns/sha.hh | 6 +---- pdns/signingpipe.hh | 5 +---- pdns/snmp-agent.hh | 6 +---- pdns/ssqlite3.hh | 7 +----- pdns/sstuff.hh | 7 +----- pdns/statbag.hh | 7 +----- pdns/tcpreceiver.hh | 6 +---- pdns/ueberbackend.hh | 6 +---- pdns/utility.hh | 7 +----- pdns/version.hh | 6 +---- pdns/webserver.hh | 5 +---- pdns/ws-api.hh | 7 +----- pdns/ws-auth.hh | 5 +---- pdns/ws-recursor.hh | 6 +---- pdns/zoneparser-tng.hh | 5 +---- 85 files changed, 143 insertions(+), 399 deletions(-) diff --git a/modules/bindbackend/bindbackend2.hh b/modules/bindbackend/bindbackend2.hh index dfb16198503f..1a33194326ef 100644 --- a/modules/bindbackend/bindbackend2.hh +++ b/modules/bindbackend/bindbackend2.hh @@ -19,10 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -#ifndef PDNS_BINDBACKEND_HH -#define PDNS_BINDBACKEND_HH - +#pragma once #include #include #include @@ -317,5 +314,3 @@ private: static void doEmptyNonTerminals(std::shared_ptr& records, const DNSName& zoneName, bool nsec3zone, NSEC3PARAMRecordContent ns3pr); void loadConfig(string *status=nullptr); }; - -#endif /* PDNS_BINDBACKEND_HH */ diff --git a/modules/geoipbackend/geoipbackend.hh b/modules/geoipbackend/geoipbackend.hh index fcf301eda1f8..1b885117bcd9 100644 --- a/modules/geoipbackend/geoipbackend.hh +++ b/modules/geoipbackend/geoipbackend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_GEOIPBACKEND_HH -#define PDNS_GEOIPBACKEND_HH - +#pragma once #include "pdns/namespaces.hh" #include @@ -79,5 +77,3 @@ private: vector d_result; vector d_files; }; - -#endif /* PDNS_GEOIPBACKEND_HH */ diff --git a/modules/geoipbackend/geoipinterface.hh b/modules/geoipbackend/geoipinterface.hh index 7b1e1805a237..1c7220b38fbd 100644 --- a/modules/geoipbackend/geoipinterface.hh +++ b/modules/geoipbackend/geoipinterface.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_GEOIPINTERFACE_HH -#define PDNS_GEOIPINTERFACE_HH - +#pragma once #include "boost/optional.hpp" #include "geoipbackend.hh" @@ -67,5 +65,3 @@ private: static unique_ptr makeMMDBInterface(const string &fname, const map& opts); static unique_ptr makeDATInterface(const string& fname, const map& opts); }; - -#endif diff --git a/modules/gmysqlbackend/gmysqlbackend.hh b/modules/gmysqlbackend/gmysqlbackend.hh index 67f6928a3121..7fc5d2f1581a 100644 --- a/modules/gmysqlbackend/gmysqlbackend.hh +++ b/modules/gmysqlbackend/gmysqlbackend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_GMYSQLBACKEND_HH -#define PDNS_GMYSQLBACKEND_HH - +#pragma once #include #include #include "pdns/backends/gsql/gsqlbackend.hh" @@ -37,5 +35,3 @@ public: protected: void reconnect() override; }; - -#endif /* PDNS_GMYSQLBACKEND_HH */ diff --git a/modules/gmysqlbackend/smysql.hh b/modules/gmysqlbackend/smysql.hh index ea6af7579e38..74c5a4bc302f 100644 --- a/modules/gmysqlbackend/smysql.hh +++ b/modules/gmysqlbackend/smysql.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SMYSQL_HH -#define SMYSQL_HH - +#pragma once #include #include "pdns/backends/gsql/ssql.hh" #include "pdns/utility.hh" @@ -65,5 +63,3 @@ private: bool d_threadCleanup; bool d_clientSSL; }; - -#endif /* SSMYSQL_HH */ diff --git a/modules/godbcbackend/godbcbackend.hh b/modules/godbcbackend/godbcbackend.hh index 473189f25376..4053ba3afe6a 100644 --- a/modules/godbcbackend/godbcbackend.hh +++ b/modules/godbcbackend/godbcbackend.hh @@ -19,6 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#pragma once #include #include "pdns/backends/gsql/gsqlbackend.hh" @@ -29,4 +30,3 @@ public: gODBCBackend( const std::string & mode, const std::string & suffix ); }; - diff --git a/modules/godbcbackend/sodbc.hh b/modules/godbcbackend/sodbc.hh index b8c369d68490..5e750595cfc4 100644 --- a/modules/godbcbackend/sodbc.hh +++ b/modules/godbcbackend/sodbc.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SODBC_HH -#define SODBC_HH - +#pragma once #include #include @@ -75,6 +73,3 @@ public: SSqlException sPerrorException( const std::string & reason ) override; }; - - -#endif // SODBC_HH diff --git a/modules/gpgsqlbackend/gpgsqlbackend.hh b/modules/gpgsqlbackend/gpgsqlbackend.hh index b1bef1da95a7..9b89db158de5 100644 --- a/modules/gpgsqlbackend/gpgsqlbackend.hh +++ b/modules/gpgsqlbackend/gpgsqlbackend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_GPGSQLBACKEND_HH -#define PDNS_GPGSQLBACKEND_HH - +#pragma once #include #include #include "pdns/backends/gsql/gsqlbackend.hh" @@ -38,5 +36,3 @@ protected: void reconnect() override; bool inTransaction() override; }; - -#endif /* PDNS_GPGSQLBACKEND_HH */ diff --git a/modules/gpgsqlbackend/spgsql.hh b/modules/gpgsqlbackend/spgsql.hh index 91720e08c547..c0aab35ca162 100644 --- a/modules/gpgsqlbackend/spgsql.hh +++ b/modules/gpgsqlbackend/spgsql.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SPGSQL_HH -#define SPGSQL_HH +#pragma once #include "pdns/namespaces.hh" #include "pdns/backends/gsql/ssql.hh" @@ -56,5 +55,3 @@ private: static bool s_dolog; bool d_in_trx; }; - -#endif /* SPGSQL_HH */ diff --git a/modules/gsqlite3backend/gsqlite3backend.hh b/modules/gsqlite3backend/gsqlite3backend.hh index 623d482674e4..2eaf3011563b 100644 --- a/modules/gsqlite3backend/gsqlite3backend.hh +++ b/modules/gsqlite3backend/gsqlite3backend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef GSQLITEBACKEND_HH -#define GSQLITEBACKEND_HH - +#pragma once #include #include "pdns/backends/gsql/gsqlbackend.hh" @@ -32,5 +30,3 @@ public: //! Constructs the backend, throws an exception if it failed.. gSQLite3Backend( const std::string & mode, const std::string & suffix ); }; - -#endif // GSQLITEBACKEND_HH diff --git a/modules/lua2backend/lua2api2.hh b/modules/lua2backend/lua2api2.hh index 1f56fc29fcd3..d61ee11805a0 100644 --- a/modules/lua2backend/lua2api2.hh +++ b/modules/lua2backend/lua2api2.hh @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #pragma once -#ifndef LUA2API_2_HH -#define LUA2API_2_HH 1 - #include "boost/lexical_cast.hpp" #include "boost/algorithm/string/join.hpp" #include "pdns/arguments.hh" @@ -418,5 +415,3 @@ private: deinit_call_t f_deinit; }; - -#endif diff --git a/modules/lua2backend/lua2backend.hh b/modules/lua2backend/lua2backend.hh index 2539d4627bfb..0bcb4567a9c6 100644 --- a/modules/lua2backend/lua2backend.hh +++ b/modules/lua2backend/lua2backend.hh @@ -20,11 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #pragma once -#ifndef LUA2BACKEND_HH -#define LUA2BACKEND_HH 1 - #include "pdns/dnsbackend.hh" #include "pdns/lua-auth4.hh" #include "lua2api2.hh" - -#endif diff --git a/modules/pipebackend/coprocess.hh b/modules/pipebackend/coprocess.hh index dd581cc9b01f..84c516e3d0ea 100644 --- a/modules/pipebackend/coprocess.hh +++ b/modules/pipebackend/coprocess.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_COPROCESS_HH -#define PDNS_COPROCESS_HH - +#pragma once #include #include #include @@ -72,4 +70,3 @@ private: FILE *d_fp; }; bool isUnixSocket(const string& fname); -#endif diff --git a/modules/pipebackend/pipebackend.hh b/modules/pipebackend/pipebackend.hh index bdb00b0a45c0..15bde4afb96d 100644 --- a/modules/pipebackend/pipebackend.hh +++ b/modules/pipebackend/pipebackend.hh @@ -19,14 +19,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PIPEBACKEND_HH -#define PIPEBACKEND_HH - +#pragma once #include #include #include - #include "pdns/namespaces.hh" #include "pdns/misc.hh" @@ -70,7 +67,3 @@ private: bool d_disavow; int d_abiVersion; }; - - -#endif - diff --git a/modules/remotebackend/remotebackend.hh b/modules/remotebackend/remotebackend.hh index 8353d18beed5..5f94d223bc4c 100644 --- a/modules/remotebackend/remotebackend.hh +++ b/modules/remotebackend/remotebackend.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef REMOTEBACKEND_REMOTEBACKEND_HH - +#pragma once #include #include @@ -228,4 +227,3 @@ class RemoteBackend : public DNSBackend void parseDomainInfo(const json11::Json &obj, DomainInfo &di); }; -#endif diff --git a/modules/tinydnsbackend/tinydnsbackend.hh b/modules/tinydnsbackend/tinydnsbackend.hh index 869083db22d9..502954671452 100644 --- a/modules/tinydnsbackend/tinydnsbackend.hh +++ b/modules/tinydnsbackend/tinydnsbackend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef TINYDNSBACKEND_HH -#define TINYDNSBACKEND_HH - +#pragma once #include "pdns/dnsbackend.hh" #include "pdns/logger.hh" #include "pdns/iputils.hh" @@ -108,5 +106,3 @@ private: static TDI_suffix_t s_domainInfo; static uint32_t s_lastId; // used to give a domain an id. }; - -#endif // TINYDNSBACKEND_HH diff --git a/pdns/anadns.hh b/pdns/anadns.hh index 34657684ef78..b1054bf9795e 100644 --- a/pdns/anadns.hh +++ b/pdns/anadns.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_ANADNS_HH -#define PDNS_ANADNS_HH +#pragma once #include #include #include @@ -83,6 +82,3 @@ inline ostream& operator<<(ostream &s, const QuestionIdentifier& qi) s<<" to " << qi.d_dest.toStringWithPort(); return s; } - - -#endif diff --git a/pdns/arguments.hh b/pdns/arguments.hh index d91a95a533e0..81f308f2a0b5 100644 --- a/pdns/arguments.hh +++ b/pdns/arguments.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef ARGUMENTS_HH -#define ARGUMENTS_HH - +#pragma once #include #include #include @@ -129,5 +127,3 @@ private: }; extern ArgvMap &arg(); - -#endif /* ARGUMENTS_HH */ diff --git a/pdns/auth-caches.hh b/pdns/auth-caches.hh index 76c248f3ca48..f7d6de9d76bc 100644 --- a/pdns/auth-caches.hh +++ b/pdns/auth-caches.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef AUTH_CACHES_HH -#define AUTH_CACHES_HH - +#pragma once #include #include @@ -30,5 +28,3 @@ uint64_t purgeAuthCaches(); /* empty all caches */ uint64_t purgeAuthCaches(const std::string& match); /* remove specific entries from all caches, can be $ terminated */ uint64_t purgeAuthCachesExact(const DNSName& qname); /* remove specific entries from all caches, no wildcard matching */ - -#endif /* AUTH_CACHES_HH */ diff --git a/pdns/auth-packetcache.hh b/pdns/auth-packetcache.hh index 5fa324c99172..0d3af47a251e 100644 --- a/pdns/auth-packetcache.hh +++ b/pdns/auth-packetcache.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef AUTH_PACKETCACHE_HH -#define AUTH_PACKETCACHE_HH - +#pragma once #include #include #include "dns.hh" @@ -148,5 +146,3 @@ private: static const unsigned int s_mincleaninterval=1000, s_maxcleaninterval=300000; }; - -#endif /* AUTH_PACKETCACHE_HH */ diff --git a/pdns/auth-querycache.hh b/pdns/auth-querycache.hh index 5fc4c55e3089..889634bb60dd 100644 --- a/pdns/auth-querycache.hh +++ b/pdns/auth-querycache.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef AUTH_QUERYCACHE_HH -#define AUTH_QUERYCACHE_HH - +#pragma once #include #include #include "dns.hh" @@ -129,5 +127,3 @@ private: static const unsigned int s_mincleaninterval=1000, s_maxcleaninterval=300000; }; - -#endif /* AUTH_QUERYCACHE_HH */ diff --git a/pdns/backends/gsql/gsqlbackend.hh b/pdns/backends/gsql/gsqlbackend.hh index aa9eb2d6267d..e13290c723db 100644 --- a/pdns/backends/gsql/gsqlbackend.hh +++ b/pdns/backends/gsql/gsqlbackend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_GSQLBACKEND_HH -#define PDNS_GSQLBACKEND_HH - +#pragma once #include #include #include "ssql.hh" @@ -411,5 +409,3 @@ protected: bool d_dnssecQueries; bool d_inTransaction{false}; }; - -#endif /* PDNS_GSQLBACKEND_HH */ diff --git a/pdns/backends/gsql/ssql.hh b/pdns/backends/gsql/ssql.hh index df71eb91fe6d..7007d5fe9042 100644 --- a/pdns/backends/gsql/ssql.hh +++ b/pdns/backends/gsql/ssql.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SSQL_HH -#define SSQL_HH - +#pragma once #include #include #include @@ -88,5 +86,3 @@ public: virtual void reconnect() {}; virtual ~SSql(){}; }; - -#endif /* SSQL_HH */ diff --git a/pdns/base32.hh b/pdns/base32.hh index d444345c98de..5e1bab47f964 100644 --- a/pdns/base32.hh +++ b/pdns/base32.hh @@ -19,11 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_BASE32_HH -#define PDNS_BASE32_HH +#pragma once #include std::string toBase32Hex(const std::string& input); std::string fromBase32Hex(const std::string& input); - -#endif diff --git a/pdns/base64.hh b/pdns/base64.hh index 37ab35b047b5..f7b39ec250e6 100644 --- a/pdns/base64.hh +++ b/pdns/base64.hh @@ -19,12 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_BASE64_HH -#define PDNS_BASE64_HH - +#pragma once #include int B64Decode(const std::string& src, std::string& dst); std::string Base64Encode (const std::string& src); - -#endif diff --git a/pdns/bindparserclasses.hh b/pdns/bindparserclasses.hh index 12e60c227e82..177a004da758 100644 --- a/pdns/bindparserclasses.hh +++ b/pdns/bindparserclasses.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef BINDPARSER_HH -#define BINDPARSER_HH +#pragma once #include #include #include @@ -97,5 +96,3 @@ private: vector d_zonedomains; bool d_verbose; }; - -#endif /* BINDPARSER_HH */ diff --git a/pdns/cdb.hh b/pdns/cdb.hh index 8673e3316615..c6069583658c 100644 --- a/pdns/cdb.hh +++ b/pdns/cdb.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef CDB_HH -#define CDB_HH - +#pragma once #include #include "misc.hh" @@ -70,5 +68,3 @@ private: struct cdb_make d_cdbm; int d_fd{-1}; }; - -#endif // CDB_HH diff --git a/pdns/comment.hh b/pdns/comment.hh index f159af3f931e..6854c094474e 100644 --- a/pdns/comment.hh +++ b/pdns/comment.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_COMMENT_HH -#define PDNS_COMMENT_HH - +#pragma once #include "utility.hh" #include "qtype.hh" #include @@ -41,5 +39,3 @@ public: int domain_id; QType qtype; //!< qtype of the associated RRset, ie A, CNAME, MX etc }; - -#endif /* PDNS_COMMENT_HH */ diff --git a/pdns/common_startup.hh b/pdns/common_startup.hh index 01f2d041e776..45c8045c0c81 100644 --- a/pdns/common_startup.hh +++ b/pdns/common_startup.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef COMMON_STARTUP_HH -#define COMMON_STARTUP_HH - +#pragma once #include "auth-packetcache.hh" #include "auth-querycache.hh" #include "utility.hh" @@ -61,5 +59,3 @@ extern bool g_LuaRecordSharedState; extern time_t g_luaHealthChecksInterval; extern time_t g_luaHealthChecksExpireDelay; #endif // HAVE_LUA_RECORDS - -#endif // COMMON_STARTUP_HH diff --git a/pdns/communicator.hh b/pdns/communicator.hh index 2b3fe7507165..0c3d479b112a 100644 --- a/pdns/communicator.hh +++ b/pdns/communicator.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_COMMUNICATOR_HH -#define PDNS_COMMUNICATOR_HH - +#pragma once #include #include #include @@ -290,6 +288,3 @@ private: } } }; - - -#endif diff --git a/pdns/distributor.hh b/pdns/distributor.hh index 30d8f76507e1..c025d897f5db 100644 --- a/pdns/distributor.hh +++ b/pdns/distributor.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef DISTRIBUTOR_HH -#define DISTRIBUTOR_HH - +#pragma once #include #include #include @@ -328,6 +326,3 @@ templateint MultiThreadDistributor< return ret; } - -#endif // DISTRIBUTOR_HH - diff --git a/pdns/dns_random.hh b/pdns/dns_random.hh index 8aa88f0d4a14..8afda61e6035 100644 --- a/pdns/dns_random.hh +++ b/pdns/dns_random.hh @@ -19,12 +19,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DNS_RANDOM -#define PDNS_DNS_RANDOM +#pragma once #include void dns_random_init(const std::string& data = "", bool force_reinit = false); uint32_t dns_random(uint32_t n); uint16_t dns_random_uint16(); - -#endif diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 321463fc45e6..c45b07e0096a 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef DNSBACKEND_HH -#define DNSBACKEND_HH +#pragma once class DNSPacket; @@ -440,5 +439,3 @@ void fillSOAData(const string &content, SOAData &data); void fillSOAData(const DNSZoneRecord& in, SOAData& data); // the reverse std::shared_ptr makeSOAContent(const SOAData& sd); - -#endif diff --git a/pdns/dnsdist-snmp.hh b/pdns/dnsdist-snmp.hh index b04518286e6a..d98870ff5956 100644 --- a/pdns/dnsdist-snmp.hh +++ b/pdns/dnsdist-snmp.hh @@ -1,6 +1,24 @@ -#ifndef DNSDIST_SNMP_HH -#define DNSDIST_SNMP_HH - +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #pragma once #include "snmp-agent.hh" @@ -17,5 +35,3 @@ public: bool sendCustomTrap(const std::string& reason); bool sendDNSTrap(const DNSQuestion&, const std::string& reason=""); }; - -#endif /* DNSDIST_SNMP_HH */ diff --git a/pdns/dnspacket.hh b/pdns/dnspacket.hh index 33414511d46d..90dd156d9e68 100644 --- a/pdns/dnspacket.hh +++ b/pdns/dnspacket.hh @@ -19,10 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef DNSPACKET_HH - -#define DNSPACKET_HH - +#pragma once #include #include #include @@ -193,5 +190,3 @@ private: bool d_haveednssection{false}; bool d_isQuery; }; - -#endif diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 3bb22f3b7ef6..e11802616458 100644 --- a/pdns/dnsparser.hh +++ b/pdns/dnsparser.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef DNSPARSER_HH -#define DNSPARSER_HH - +#pragma once #include #include #include @@ -526,5 +524,3 @@ private: uint32_t d_notyouroffset; // only 'moveOffset' can touch this const uint32_t& d_offset; // look.. but don't touch }; - -#endif diff --git a/pdns/dnspcap.hh b/pdns/dnspcap.hh index 1b9b0e2800e3..a8a6e9a1201c 100644 --- a/pdns/dnspcap.hh +++ b/pdns/dnspcap.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DNSPCAP_HH -#define PDNS_DNSPCAP_HH - +#pragma once #include #include #include "iputils.hh" @@ -143,5 +141,3 @@ private: FILE *d_fp; bool d_first{true}; }; - -#endif // DNSPCAP_HH diff --git a/pdns/dnsproxy.hh b/pdns/dnsproxy.hh index c4091f59dafb..e9b5807af498 100644 --- a/pdns/dnsproxy.hh +++ b/pdns/dnsproxy.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DNSPROXY -#define PDNS_DNSPROXY +#pragma once #include #include #include @@ -91,5 +90,3 @@ private: int getID_locked(); uint16_t d_xor; }; - -#endif diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 1031ddf59dd7..3c2ab3d6f884 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DNSRECORDS_HH -#define PDNS_DNSRECORDS_HH - +#pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -903,4 +901,3 @@ void reportOtherTypes(); void reportAllTypes(); ComboAddress getAddr(const DNSRecord& dr, uint16_t defport=0); void checkHostnameCorrectness(const DNSResourceRecord& rr); -#endif diff --git a/pdns/dnssecinfra.hh b/pdns/dnssecinfra.hh index 440edc981a44..f8ff86e75c2c 100644 --- a/pdns/dnssecinfra.hh +++ b/pdns/dnssecinfra.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DNSSECINFRA_HH -#define PDNS_DNSSECINFRA_HH - +#pragma once #include "dnsrecords.hh" #include @@ -175,4 +173,3 @@ void addTSIG(DNSPacketWriter& pw, TSIGRecordContent& trc, const DNSName& tsigkey bool validateTSIG(const std::string& packet, size_t sigPos, const TSIGTriplet& tt, const TSIGRecordContent& trc, const std::string& previousMAC, const std::string& theirMAC, bool timersOnly, unsigned int dnsHeaderOffset=0); uint64_t signatureCacheSize(const std::string& str); -#endif diff --git a/pdns/dnswriter.hh b/pdns/dnswriter.hh index fbfcd4739ad3..58b1bf2a4db2 100644 --- a/pdns/dnswriter.hh +++ b/pdns/dnswriter.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DNSWRITER_HH -#define PDNS_DNSWRITER_HH - +#pragma once #include #include #include @@ -173,4 +171,4 @@ private: typedef vector > labelparts_t; // bool labeltokUnescape(labelparts_t& parts, const DNSName& label); std::vector segmentDNSText(const string& text); // from dnslabeltext.rl -#endif +std::deque segmentDNSName(const string& input); // from dnslabeltext.rl diff --git a/pdns/doh.hh b/pdns/doh.hh index dbcfbb31ab55..f7f9a80aaa7b 100644 --- a/pdns/doh.hh +++ b/pdns/doh.hh @@ -1,3 +1,24 @@ +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #pragma once #include "iputils.hh" #include "libssl.hh" diff --git a/pdns/dynhandler.hh b/pdns/dynhandler.hh index 6a7ab6e694e3..774ae5c4bac2 100644 --- a/pdns/dynhandler.hh +++ b/pdns/dynhandler.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DYNHANDLER_HH -#define PDNS_DYNHANDLER_HH - +#pragma once #include #include #include @@ -57,4 +55,3 @@ string DLCurrentConfigHandler(const vector&parts, Utility::pid_t ppid); string DLListZones(const vector&parts, Utility::pid_t ppid); string DLTokenLogin(const vector&parts, Utility::pid_t ppid); uint64_t udpErrorStats(const std::string& str); -#endif /* PDNS_DYNHANDLER_HH */ diff --git a/pdns/dynlistener.hh b/pdns/dynlistener.hh index 62fc6fc78357..da61661ccb4c 100644 --- a/pdns/dynlistener.hh +++ b/pdns/dynlistener.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_DYNLISTENER -#define PDNS_DYNLISTENER - +#pragma once #include #include #include @@ -79,4 +77,3 @@ private: static g_funk_t* s_restfunc; bool testLive(const string& fname); }; -#endif /* PDNS_DYNLISTENER */ diff --git a/pdns/dynmessenger.hh b/pdns/dynmessenger.hh index c9e60d5e9db8..100fd3636b67 100644 --- a/pdns/dynmessenger.hh +++ b/pdns/dynmessenger.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef DYNMESSENGER_HH -#define DYNMESSENGER_HH - +#pragma once #include #include #include @@ -62,5 +60,3 @@ public: int send(const string &message) const; //!< Send a message to a DynListener string receive() const; //!< receive an answer from a DynListener }; - -#endif diff --git a/pdns/ednscookies.hh b/pdns/ednscookies.hh index 7dce62bbe3db..4e6f42e6cd62 100644 --- a/pdns/ednscookies.hh +++ b/pdns/ednscookies.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_EDNSCOOKIES_HH -#define PDNS_EDNSCOOKIES_HH - +#pragma once #include "namespaces.hh" struct EDNSCookiesOpt @@ -33,4 +31,3 @@ struct EDNSCookiesOpt bool getEDNSCookiesOptFromString(const char* option, unsigned int len, EDNSCookiesOpt* eco); bool getEDNSCookiesOptFromString(const string& option, EDNSCookiesOpt* eco); string makeEDNSCookiesOptString(const EDNSCookiesOpt& eco); -#endif diff --git a/pdns/ednsoptions.hh b/pdns/ednsoptions.hh index 4c8a330cebc3..cbd7b0d0a020 100644 --- a/pdns/ednsoptions.hh +++ b/pdns/ednsoptions.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_EDNSOPTIONS_HH -#define PDNS_EDNSOPTIONS_HH - +#pragma once #include "namespaces.hh" struct EDNSOptionCode @@ -51,5 +49,3 @@ int getEDNSOptions(const char* optRR, size_t len, EDNSOptionViewMap& options); bool getEDNSOptionsFromContent(const std::string& content, std::vector>& options); void generateEDNSOption(uint16_t optionCode, const std::string& payload, std::string& res); - -#endif diff --git a/pdns/ednssubnet.hh b/pdns/ednssubnet.hh index eb87b488e6fa..b0f6e485bf70 100644 --- a/pdns/ednssubnet.hh +++ b/pdns/ednssubnet.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_EDNSSUBNET_HH -#define PDNS_EDNSSUBNET_HH - +#pragma once #include "namespaces.hh" #include "iputils.hh" #include "dnsname.hh" @@ -35,4 +33,3 @@ struct EDNSSubnetOpts bool getEDNSSubnetOptsFromString(const string& options, EDNSSubnetOpts* eso); bool getEDNSSubnetOptsFromString(const char* options, unsigned int len, EDNSSubnetOpts* eso); string makeEDNSSubnetOptsString(const EDNSSubnetOpts& eso); -#endif diff --git a/pdns/gss_context.hh b/pdns/gss_context.hh index 8dea90147a1d..a5d3160707be 100644 --- a/pdns/gss_context.hh +++ b/pdns/gss_context.hh @@ -19,8 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef GSS_CONTEXT_HH -#define GSS_CONTEXT_HH #pragma once #ifdef ENABLE_GSS_TSIG @@ -180,5 +178,3 @@ public: bool gss_add_signature(const DNSName& context, const std::string& message, std::string& mac); // #include #include @@ -1404,5 +1402,3 @@ size_t sendMsgWithOptions(int fd, const char* buffer, size_t len, const ComboAdd bool isTCPSocketUsable(int sock); extern template class NetmaskTree; - -#endif diff --git a/pdns/lazy_allocator.hh b/pdns/lazy_allocator.hh index 68ba53619ecf..986f91bdaed8 100644 --- a/pdns/lazy_allocator.hh +++ b/pdns/lazy_allocator.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef LAZY_ALLOCATOR_HH -#define LAZY_ALLOCATOR_HH - +#pragma once #include #include #include @@ -86,5 +84,3 @@ template inline bool operator!= (lazy_allocator const&, lazy_allocator const&) noexcept { return false; } - -#endif // LAZY_ALLOCATOR_HH diff --git a/pdns/lock.hh b/pdns/lock.hh index 895d346e06b4..7e9a11547b57 100644 --- a/pdns/lock.hh +++ b/pdns/lock.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef LOCK_HH -#define LOCK_HH - +#pragma once #include #include #include "misc.hh" @@ -87,7 +85,6 @@ public: WriteLock(const WriteLock& rhs) = delete; WriteLock& operator=(const WriteLock& rhs) = delete; - }; class TryWriteLock @@ -217,4 +214,3 @@ public: ReadLock(const ReadLock& rhs) = delete; ReadLock& operator=(const ReadLock& rhs) = delete; }; -#endif diff --git a/pdns/lwres.hh b/pdns/lwres.hh index 510ae9e23def..36a6d714fcd4 100644 --- a/pdns/lwres.hh +++ b/pdns/lwres.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_LWRES_HH -#define PDNS_LWRES_HH +#pragma once #include #include #include @@ -71,4 +70,3 @@ public: }; int asyncresolve(const ComboAddress& ip, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, boost::optional& srcmask, boost::optional context, const std::shared_ptr>>& outgoingLoggers, const std::shared_ptr>>& fstrmLoggers, const std::set& exportTypes, LWResult* res, bool* chained); -#endif // PDNS_LWRES_HH diff --git a/pdns/mplexer.hh b/pdns/mplexer.hh index b14a39dc931f..a2cd0b75075d 100644 --- a/pdns/mplexer.hh +++ b/pdns/mplexer.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_MPLEXER_HH -#define PDNS_MPLEXER_HH +#pragma once #include #include #include @@ -237,7 +236,3 @@ protected: } } }; - - -#endif - diff --git a/pdns/mtasker.hh b/pdns/mtasker.hh index 0365e756a269..bff0eca0ff1c 100644 --- a/pdns/mtasker.hh +++ b/pdns/mtasker.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MTASKER_HH -#define MTASKER_HH +#pragma once #include #include #include @@ -136,6 +135,3 @@ private: EventKey d_eventkey; // for waitEvent, contains exact key it was awoken for }; #include "mtasker.cc" - -#endif // MTASKER_HH - diff --git a/pdns/mtasker_context.hh b/pdns/mtasker_context.hh index 2e35fed3297e..3c1a95b14368 100644 --- a/pdns/mtasker_context.hh +++ b/pdns/mtasker_context.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MTASKER_CONTEXT_HH -#define MTASKER_CONTEXT_HH - +#pragma once #include "lazy_allocator.hh" #include #include @@ -85,6 +83,3 @@ static inline void notifyStackSwitchDone() #endif /* HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR */ #endif /* HAVE_FIBER_SANITIZER */ } - - -#endif // MTASKER_CONTEXT_HH diff --git a/pdns/nameserver.hh b/pdns/nameserver.hh index d592345ade02..521d5387517b 100644 --- a/pdns/nameserver.hh +++ b/pdns/nameserver.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef NAMESERVER_HH -#define NAMESERVER_HH - +#pragma once #include #include #include @@ -104,5 +102,3 @@ private: bool AddressIsUs(const ComboAddress& remote); extern ResponseStats g_rs; - -#endif diff --git a/pdns/namespaces.hh b/pdns/namespaces.hh index 565b67d9b19c..64ecaac4a87b 100644 --- a/pdns/namespaces.hh +++ b/pdns/namespaces.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_NAMESPACES_HH -#define PDNS_NAMESPACES_HH +#pragma once #include #include #include @@ -77,5 +76,3 @@ using boost::trim_right_copy_if; using boost::equals; using boost::ends_with; using boost::iends_with; - -#endif diff --git a/pdns/packetcache.hh b/pdns/packetcache.hh index 7b2f1a8b38b6..7dd0c8828e5f 100644 --- a/pdns/packetcache.hh +++ b/pdns/packetcache.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PACKETCACHE_HH -#define PACKETCACHE_HH - +#pragma once #include "ednsoptions.hh" #include "misc.hh" #include "iputils.hh" @@ -148,5 +146,3 @@ public: } }; - -#endif /* PACKETCACHE_HH */ diff --git a/pdns/packethandler.hh b/pdns/packethandler.hh index 2b9cd6144a3b..48cdfbabdad8 100644 --- a/pdns/packethandler.hh +++ b/pdns/packethandler.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PACKETHANDLER_HH -#define PACKETHANDLER_HH - +#pragma once #include #include #include @@ -118,4 +116,3 @@ private: }; std::shared_ptr makeSOAContent(const SOAData& sd); -#endif /* PACKETHANDLER */ diff --git a/pdns/pdnsexception.hh b/pdns/pdnsexception.hh index f820f551599f..67fce0adcec6 100644 --- a/pdns/pdnsexception.hh +++ b/pdns/pdnsexception.hh @@ -19,10 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNSEXCEPTION_HH -#define PDNSEXCEPTION_HH -/* (C) 2002 POWERDNS.COM BV */ - +#pragma once #include #include "namespaces.hh" @@ -43,5 +40,3 @@ public: TimeoutException() : PDNSException() {} TimeoutException(string r) : PDNSException(r) {} }; - -#endif diff --git a/pdns/pkcs11signers.hh b/pdns/pkcs11signers.hh index 094eddf81fc7..ae3648b4d010 100644 --- a/pdns/pkcs11signers.hh +++ b/pdns/pkcs11signers.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_PKCS11SIGNERS_HH -#define PDNS_PKCS11SIGNERS_HH +#pragma once class PKCS11DNSCryptoKeyEngine : public DNSCryptoKeyEngine { @@ -67,5 +66,3 @@ class PKCS11DNSCryptoKeyEngine : public DNSCryptoKeyEngine }; bool PKCS11ModuleSlotLogin(const std::string& module, const string& tokenId, const std::string& pin); - -#endif /* PDNS_PKCS11SIGNERS_HH */ diff --git a/pdns/qtype.hh b/pdns/qtype.hh index d94238f13243..03b6c8a5c78d 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef QTYPE_HH -#define QTYPE_HH -// $Id$ +#pragma once #include #include #include "namespaces.hh" @@ -237,4 +235,3 @@ struct QClass { enum QClassEnum {IN=1, CHAOS=3, NONE=254, ANY=255}; }; -#endif diff --git a/pdns/rcpgenerator.hh b/pdns/rcpgenerator.hh index 6553ffac1e53..d17c750b47e8 100644 --- a/pdns/rcpgenerator.hh +++ b/pdns/rcpgenerator.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_RCPGENERATOR_HH -#define PDNS_RCPGENERATOR_HH +#pragma once #include #include #include @@ -106,4 +105,3 @@ private: string& d_string; bool d_nodot; }; -#endif diff --git a/pdns/rec-snmp.hh b/pdns/rec-snmp.hh index 3ccc73fb1380..c803fa549539 100644 --- a/pdns/rec-snmp.hh +++ b/pdns/rec-snmp.hh @@ -1,6 +1,24 @@ -#ifndef REC_SNMP_HH -#define REC_SNMP_HH - +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #pragma once #include "snmp-agent.hh" @@ -15,5 +33,3 @@ public: }; extern std::shared_ptr g_snmpAgent; - -#endif /* REC_SNMP_HH */ diff --git a/pdns/recpacketcache.hh b/pdns/recpacketcache.hh index c1930cddfa2f..790d714fb879 100644 --- a/pdns/recpacketcache.hh +++ b/pdns/recpacketcache.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_RECPACKETCACHE_HH -#define PDNS_RECPACKETCACHE_HH +#pragma once #include #include #include "dns.hh" @@ -118,5 +117,3 @@ public: { } }; - -#endif diff --git a/pdns/recursor_cache.hh b/pdns/recursor_cache.hh index 00348c4b5744..21c6991e8913 100644 --- a/pdns/recursor_cache.hh +++ b/pdns/recursor_cache.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef RECURSOR_CACHE_HH -#define RECURSOR_CACHE_HH +#pragma once #include #include #include "dns.hh" @@ -219,4 +218,3 @@ public: } } }; -#endif diff --git a/pdns/resolver.hh b/pdns/resolver.hh index 979c32ce2358..17b4b7ccdd4f 100644 --- a/pdns/resolver.hh +++ b/pdns/resolver.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_RESOLVER_HH -#define PDNS_RESOLVER_HH - +#pragma once #include #include #include @@ -106,6 +104,3 @@ class AXFRRetriever : public boost::noncopyable size_t d_maxReceivedBytes; TSIGRecordContent d_trc; }; - - -#endif /* PDNS_RESOLVER_HH */ diff --git a/pdns/secpoll-auth.hh b/pdns/secpoll-auth.hh index 04f4422919e0..5aaa20b790e2 100644 --- a/pdns/secpoll-auth.hh +++ b/pdns/secpoll-auth.hh @@ -19,13 +19,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_SECPOLL_AUTH_HH -#define PDNS_SECPOLL_AUTH_HH +#pragma once #include #include "namespaces.hh" #include "stubresolver.hh" void doSecPoll(bool first); extern std::string g_security_message; - -#endif diff --git a/pdns/secpoll-recursor.hh b/pdns/secpoll-recursor.hh index 36cd731de64b..e4790d1208fb 100644 --- a/pdns/secpoll-recursor.hh +++ b/pdns/secpoll-recursor.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_SECPOLL_RECURSOR_HH -#define PDNS_SECPOLL_RECURSOR_HH +#pragma once #include #include "namespaces.hh" #include @@ -28,5 +27,3 @@ void doSecPoll(time_t* ); extern uint32_t g_security_status; extern std::string g_security_message; - -#endif diff --git a/pdns/sha.hh b/pdns/sha.hh index 19363ced715e..06bace9ab7b1 100644 --- a/pdns/sha.hh +++ b/pdns/sha.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef _SHA_HH -#define _SHA_HH - +#pragma once #include #include #include @@ -53,5 +51,3 @@ inline std::string pdns_sha512sum(const std::string& input) SHA512(reinterpret_cast(input.c_str()), input.length(), result); return std::string(result, result + sizeof result); } - -#endif /* sha.hh */ diff --git a/pdns/signingpipe.hh b/pdns/signingpipe.hh index e776031049b7..301e2f4ebe74 100644 --- a/pdns/signingpipe.hh +++ b/pdns/signingpipe.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_SIGNINGPIPE -#define PDNS_SIGNINGPIPE +#pragma once #include #include #include @@ -80,5 +79,3 @@ private: bool d_mustSign; bool d_final; }; - -#endif diff --git a/pdns/snmp-agent.hh b/pdns/snmp-agent.hh index 5d693bb6bc10..c304aad47c3c 100644 --- a/pdns/snmp-agent.hh +++ b/pdns/snmp-agent.hh @@ -1,6 +1,4 @@ -#ifndef SNMP_AGENT_HH -#define SNMP_AGENT_HH - +#pragma once #include "config.h" #include @@ -62,5 +60,3 @@ private: std::thread d_thread; }; - -#endif /* SNMP_AGENT_HH */ diff --git a/pdns/ssqlite3.hh b/pdns/ssqlite3.hh index 5768337b2039..06bdf56d5eea 100644 --- a/pdns/ssqlite3.hh +++ b/pdns/ssqlite3.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SSQLITE3_HH -#define SSQLITE3_HH - +#pragma once #include #include "pdns/backends/gsql/ssql.hh" @@ -57,6 +55,3 @@ public: //! Used to create an backend specific exception message. SSqlException sPerrorException( const std::string & reason ) override; }; - -#endif // SSQLITE3_HH - diff --git a/pdns/sstuff.hh b/pdns/sstuff.hh index cb75335509cd..7f61a4f8b18b 100644 --- a/pdns/sstuff.hh +++ b/pdns/sstuff.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SSTUFF_HH -#define SSTUFF_HH - +#pragma once #include #include #include @@ -360,6 +358,3 @@ private: std::string d_buffer; int d_socket; }; - - -#endif diff --git a/pdns/statbag.hh b/pdns/statbag.hh index 4d8bd3a308be..0ee875917c22 100644 --- a/pdns/statbag.hh +++ b/pdns/statbag.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef STATBAG_HH -#define STATBAG_HH +#pragma once #include #include #include @@ -33,7 +32,6 @@ #include "circular_buffer.hh" - template > class StatRing { @@ -156,6 +154,3 @@ inline void StatBag::inc(const string &key) { deposit(key,1); } - - -#endif /* STATBAG_HH */ diff --git a/pdns/tcpreceiver.hh b/pdns/tcpreceiver.hh index 87c7d0f71b09..cafe7943312e 100644 --- a/pdns/tcpreceiver.hh +++ b/pdns/tcpreceiver.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_TCPRECEIVER_HH -#define PDNS_TCPRECEIVER_HH - +#pragma once #include "dns.hh" #include "iputils.hh" #include "dnsbackend.hh" @@ -76,5 +74,3 @@ private: vectord_sockets; vector d_prfds; }; - -#endif /* PDNS_TCPRECEIVER_HH */ diff --git a/pdns/ueberbackend.hh b/pdns/ueberbackend.hh index 062645d4442a..131cf1d184e3 100644 --- a/pdns/ueberbackend.hh +++ b/pdns/ueberbackend.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef UEBERBACKEND_HH -#define UEBERBACKEND_HH - +#pragma once #include #include #include @@ -165,5 +163,3 @@ private: void addCache(const Question &q, const vector &rrs); }; - -#endif diff --git a/pdns/utility.hh b/pdns/utility.hh index 081de34aa850..d94f299cb9eb 100644 --- a/pdns/utility.hh +++ b/pdns/utility.hh @@ -20,9 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ // Utility class specification. - -#ifndef UTILITY_HH -#define UTILITY_HH +#pragma once #ifdef NEED_POSIX_TYPEDEF typedef unsigned char uint8_t; @@ -144,6 +142,3 @@ public: static time_t timegm(struct tm *tm); }; - - -#endif // UTILITY_HH diff --git a/pdns/version.hh b/pdns/version.hh index a5f839c8f95a..66944da9153a 100644 --- a/pdns/version.hh +++ b/pdns/version.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef VERSION_HH -#define VERSION_HH - +#pragma once #include "namespaces.hh" enum ProductType { ProductAuthoritative, ProductRecursor }; @@ -35,5 +33,3 @@ string productName(); string productTypeApiType(); void versionSetProduct(ProductType pt); ProductType versionGetProduct(); - -#endif //!VERSION_HH diff --git a/pdns/webserver.hh b/pdns/webserver.hh index aa62b73f2fcf..ea98581c93f2 100644 --- a/pdns/webserver.hh +++ b/pdns/webserver.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef WEBSERVER_HH -#define WEBSERVER_HH +#pragma once #include #include #include @@ -242,5 +241,3 @@ protected: // Describes the amount of logging the webserver does WebServer::LogLevel d_loglevel{WebServer::LogLevel::Detailed}; }; - -#endif /* WEBSERVER_HH */ diff --git a/pdns/ws-api.hh b/pdns/ws-api.hh index e280a20abed8..d242110afda8 100644 --- a/pdns/ws-api.hh +++ b/pdns/ws-api.hh @@ -19,10 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -#ifndef PDNS_WSAPI_HH -#define PDNS_WSAPI_HH - +#pragma once #include #include "webserver.hh" @@ -42,5 +39,3 @@ DNSName apiNameToDNSName(const string& name); // To be provided by product code. void productServerStatisticsFetch(std::map& out); boost::optional productServerStatisticsFetch(const std::string& name); - -#endif /* PDNS_WSAPI_HH */ diff --git a/pdns/ws-auth.hh b/pdns/ws-auth.hh index e42ec43baaa4..b613174f6216 100644 --- a/pdns/ws-auth.hh +++ b/pdns/ws-auth.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef WS_HH -#define WS_HH +#pragma once #include #include #include @@ -97,5 +96,3 @@ private: Ewma d_qcachehits, d_qcachemisses; WebServer *d_ws{nullptr}; }; - -#endif diff --git a/pdns/ws-recursor.hh b/pdns/ws-recursor.hh index ae8e47568a4d..897316b64727 100644 --- a/pdns/ws-recursor.hh +++ b/pdns/ws-recursor.hh @@ -19,9 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_WSRECURSOR_HH -#define PDNS_WSRECURSOR_HH - +#pragma once #include #include "namespaces.hh" #include "mplexer.hh" @@ -71,5 +69,3 @@ public: private: std::unique_ptr d_ws{nullptr}; }; - -#endif /* PDNS_WSRECURSOR_HH */ diff --git a/pdns/zoneparser-tng.hh b/pdns/zoneparser-tng.hh index 437eb14a36e8..8cb2788a2253 100644 --- a/pdns/zoneparser-tng.hh +++ b/pdns/zoneparser-tng.hh @@ -19,8 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef PDNS_ZONEPARSER_TNG -#define PDNS_ZONEPARSER_TNG +#pragma once #include #include #include @@ -78,5 +77,3 @@ private: bool d_fromfile; bool d_generateEnabled{true}; }; - -#endif