Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Jul 22, 2024
1 parent c3b76b1 commit b4fd9d0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .not-formatted
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@
./pdns/uuid-utils.cc
./pdns/validate.cc
./pdns/validate.hh
./pdns/version.cc
./pdns/version.hh
./pdns/webserver.cc
./pdns/webserver.hh
./pdns/zone2json.cc
Expand Down
24 changes: 13 additions & 11 deletions pdns/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +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.
*/
#ifdef HAVE_CONFIG_H

#include "config.h"
#endif

#include "logger.hh"
#include "version.hh"
#include "dnsbackend.hh"
Expand All @@ -33,11 +33,11 @@ static ProductType productType;
string compilerVersion()
{
#if defined(__clang__)
return string("clang " __clang_version__);
return "clang " __clang_version__;
#elif defined(__GNUC__)
return string("gcc " __VERSION__);
return "gcc " __VERSION__;
#else // add other compilers here
return string("Unknown compiler");
return "Unknown compiler";
#endif
}

Expand Down Expand Up @@ -188,9 +188,11 @@ void showBuildConfiguration()
const auto& modules = BackendMakers().getModules();
g_log << Logger::Warning << "Loaded modules: " << boost::join(modules, " ") << endl;
#endif
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
#ifdef PDNS_CONFIG_ARGS
#define double_escape(s) #s
#define escape_quotes(s) double_escape(s)
// NOLINTEND(cppcoreguidelines-macro-usage)
g_log << Logger::Warning << "Configured with: " << escape_quotes(PDNS_CONFIG_ARGS) << endl;
#undef escape_quotes
#undef double_escape
Expand All @@ -199,17 +201,17 @@ void showBuildConfiguration()

string fullVersionString()
{
ostringstream s;
s << productName() << " " VERSION;
ostringstream ret;
ret << productName() << " " VERSION;
#ifndef REPRODUCIBLE
s << " (built " __DATE__ " " __TIME__ " by " BUILD_HOST ")";
ret << " (built " __DATE__ " " __TIME__ " by " BUILD_HOST ")";
#endif
return s.str();
return ret.str();
}

void versionSetProduct(ProductType pt)
void versionSetProduct(ProductType productType_)
{
productType = pt;
productType = productType_;
}

ProductType versionGetProduct()
Expand Down
14 changes: 7 additions & 7 deletions pdns/version.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "namespaces.hh"
#include <string>

enum ProductType
{
ProductAuthoritative,
ProductRecursor
};

string compilerVersion();
std::string compilerVersion();
void showProductVersion();
void showBuildConfiguration();
string fullVersionString();
string getPDNSVersion();
string productName();
string productTypeApiType();
void versionSetProduct(ProductType pt);
std::string fullVersionString();
std::string getPDNSVersion();
std::string productName();
std::string productTypeApiType();
void versionSetProduct(ProductType productType_);
ProductType versionGetProduct();

0 comments on commit b4fd9d0

Please sign in to comment.