diff --git a/ostd/environ.hh b/ostd/environ.hh index 47ac05f..20749f6 100644 --- a/ostd/environ.hh +++ b/ostd/environ.hh @@ -18,9 +18,8 @@ /* TODO: make POSIX version thread safe, the Windows version is... */ namespace ostd { -namespace envvar { -inline Maybe get(ConstCharRange name) { +inline Maybe 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 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 diff --git a/test_runner.cc b/test_runner.cc index d1efff7..69df863 100644 --- a/test_runner.cc +++ b/test_runner.cc @@ -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 */