Skip to content

Commit 5f31282

Browse files
committed
Fix MinGW compilation
1 parent 809414d commit 5f31282

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/loguru/loguru.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,11 @@ namespace loguru
655655

656656
const char* home_dir()
657657
{
658-
#ifdef _WIN32
658+
#ifdef __MINGW32__
659+
auto home = getenv("USERPROFILE");
660+
CHECK_F(home != nullptr, "Missing USERPROFILE");
661+
return home;
662+
#elif defined(_WIN32)
659663
char* user_profile;
660664
size_t len;
661665
errno_t err = _dupenv_s(&user_profile, &len, "USERPROFILE");

0 commit comments

Comments
 (0)