From 75068e7d753cf6cbe45a4bf294000dca9bd41d8b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Sep 2006 21:06:23 +0000 Subject: * Use a proper namespace. * Optimise header file usage a bit. * Compile the parser as C++. --- src/libstore/globals.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/libstore/globals.cc') diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index f61fe167d870..466d0e0b26d7 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -1,9 +1,13 @@ #include "globals.hh" +#include "util.hh" #include #include +namespace nix { + + string nixStore = "/UNINIT"; string nixDataDir = "/UNINIT"; string nixLogDir = "/UNINIT"; @@ -23,7 +27,7 @@ string thisSystem = "unset"; static bool settingsRead = false; -static map settings; +static std::map settings; string & at(Strings & ss, unsigned int n) @@ -72,7 +76,7 @@ static void readSettings() Strings querySetting(const string & name, const Strings & def) { if (!settingsRead) readSettings(); - map::iterator i = settings.find(name); + std::map::iterator i = settings.find(name); return i == settings.end() ? def : i->second; } @@ -98,3 +102,6 @@ bool queryBoolSetting(const string & name, bool def) else throw Error(format("configuration option `%1%' should be either `true' or `false', not `%2%'") % name % v); } + + +} -- cgit 1.4.1