remove namespace

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

View file

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