Fix some Windows issues

This commit is contained in:
Georg Hagen
2025-02-09 18:30:32 +01:00
parent 3c7c6ae207
commit 8bbb22bd64
2 changed files with 11 additions and 9 deletions

View File

@@ -56,8 +56,7 @@ namespace OpenVulkano
[[nodiscard]] std::filesystem::path GetXDGFolderDefault(const char* envName, std::string_view defaultRelativePath)
{
#ifndef TARGET_OS_IOS != 1
const char* envValue = std::getenv(envName);
if (envValue)
if (const char* envValue = std::getenv(envName))
{
if (envValue[0] == '/') return envValue;
std::cerr << "Ignoring environment '" << envName << "' (value: '" << envValue << "') because it's relative! XDG specifies it should be absolute path. Falling back to default path.";