suckle
This commit is contained in:
parent
2219182539
commit
9695ceec8a
13 changed files with 261 additions and 262 deletions
|
@ -121,8 +121,7 @@ fn LogImpl(const LogLevel level, const std::source_location& loc, std::format_st
|
|||
-> void {
|
||||
using namespace std::chrono;
|
||||
|
||||
const time_point<system_clock, duration<long long, std::ratio<1, 1>>> now =
|
||||
std::chrono::floor<std::chrono::seconds>(std::chrono::system_clock::now());
|
||||
const time_point<system_clock, duration<i64>> now = std::chrono::floor<seconds>(system_clock::now());
|
||||
|
||||
const auto [color, levelStr] = [&] {
|
||||
switch (level) {
|
||||
|
|
|
@ -259,12 +259,12 @@ using NowPlayingError = std::variant<
|
|||
|
||||
enum class EnvError : u8 { NotFound, AccessError };
|
||||
|
||||
inline auto GetEnv(const String& name) -> Result<String, EnvError> {
|
||||
inline auto GetEnv(CStr name) -> Result<String, EnvError> {
|
||||
#ifdef _WIN32
|
||||
char* rawPtr = nullptr;
|
||||
usize bufferSize = 0;
|
||||
|
||||
const i32 err = _dupenv_s(&rawPtr, &bufferSize, name.c_str());
|
||||
const i32 err = _dupenv_s(&rawPtr, &bufferSize, name);
|
||||
|
||||
const UniquePointer<char, decltype(&free)> ptrManager(rawPtr, free);
|
||||
|
||||
|
@ -276,7 +276,7 @@ inline auto GetEnv(const String& name) -> Result<String, EnvError> {
|
|||
|
||||
return ptrManager.get();
|
||||
#else
|
||||
CStr value = std::getenv(name.c_str());
|
||||
const CStr value = std::getenv(name);
|
||||
|
||||
if (!value)
|
||||
return Err(EnvError::NotFound);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue