remove namespace

master
Daniel Kolesa 2016-07-08 19:48:11 +01:00
parent 115da8be30
commit 88241f5f9e
2 changed files with 7 additions and 9 deletions

View File

@ -18,9 +18,8 @@
/* TODO: make POSIX version thread safe, the Windows version is... */
namespace ostd {
namespace envvar {
inline Maybe<String> get(ConstCharRange name) {
inline Maybe<String> env_get(ConstCharRange name) {
char buf[256];
auto tbuf = to_temp_cstr(name, buf, sizeof(buf));
#ifndef OSTD_PLATFORM_WIN32
@ -43,8 +42,8 @@ inline Maybe<String> get(ConstCharRange name) {
#endif
}
inline bool set(ConstCharRange name, ConstCharRange value,
bool update = true) {
inline bool env_set(ConstCharRange name, ConstCharRange value,
bool update = true) {
char sbuf[2048];
char *buf = sbuf;
bool alloc = (name.size() + value.size() + 2) > sizeof(sbuf);
@ -66,7 +65,7 @@ inline bool set(ConstCharRange name, ConstCharRange value,
return ret;
}
inline bool unset(ConstCharRange name) {
inline bool env_unset(ConstCharRange name) {
char buf[256];
if (name.size() < sizeof(buf)) {
memcpy(buf, name.data(), name.size());
@ -84,7 +83,6 @@ inline bool unset(ConstCharRange name) {
#endif
}
} /* namespace envvar */
} /* namespace ostd */
#endif

View File

@ -24,13 +24,13 @@ constexpr auto ColorEnd = "";
int main() {
/* configurable section */
auto compiler = envvar::get("CXX").value_or("c++");
auto compiler = env_get("CXX").value_or("c++");
auto cxxflags = "-std=c++14 -I. -Wall -Wextra -Wshadow -Wold-style-cast "
"-Wno-missing-braces"; /* clang false positive */
auto testdir = envvar::get("TESTDIR").value_or("tests");
auto testdir = env_get("TESTDIR").value_or("tests");
auto srcext = ".cc";
auto userflags = envvar::get("CXXFLAGS").value_or("");
auto userflags = env_get("CXXFLAGS").value_or("");
/* do not change past this point */