From 1484d74c1dfd24cfe5b6f13f76d58ff395e4d253 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 10 Jan 2023 16:00:36 +0100 Subject: Put ctor.h contents in ctor namespace. --- src/configure.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/configure.cc') diff --git a/src/configure.cc b/src/configure.cc index 25403f7..28049ae 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -16,25 +16,25 @@ #include "rebuild.h" #include "externals.h" +using namespace ctor; + std::filesystem::path configurationFile("configuration.cc"); std::filesystem::path configHeaderFile("config.h"); std::map external_includedir; std::map external_libdir; +namespace ctor { const Configuration default_configuration{}; const Configuration& __attribute__((weak)) configuration() { return default_configuration; } -namespace ctor -{ std::optional includedir; std::optional libdir; std::optional builddir; std::map conf_values; -} bool hasConfiguration(const std::string& key) { @@ -93,6 +93,7 @@ const std::string& getConfiguration(const std::string& key, return defaultValue; } +} // namespace ctor:: std::string locate(const std::string& arch, const std::string& app) { @@ -419,6 +420,7 @@ int regenerateCache(Settings& settings, { std::ofstream istr(configurationFile); istr << "#include \n\n"; + istr << "namespace ctor {\n"; istr << "const Configuration& configuration()\n"; istr << "{\n"; istr << " static Configuration cfg =\n"; @@ -528,7 +530,8 @@ int regenerateCache(Settings& settings, istr << " },\n"; istr << " };\n"; istr << " return cfg;\n"; - istr << "}\n\n"; + istr << "}\n"; + istr << "} // namespace ctor::\n\n"; } { -- cgit v1.2.3