Skip to content

Commit

Permalink
Fix dlang#19369 - use _getcwd on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilsonator committed Dec 15, 2024
1 parent 3fa3ac8 commit dd05a55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion compiler/src/dmd/backend/dwarfdbginf.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import dmd.backend.cdef;
version(Windows)
{
nothrow
private extern (C) char* getcwd(char* buffer, size_t maxlen);
private extern (C) char* _getcwd(char* buffer, size_t maxlen);
alias getcwd = _getcwd;
nothrow
private extern (C) int* _errno(); // not the multi-threaded version
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dmd/json.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import dmd.target;
import dmd.visitor;

version(Windows) {
extern (C) char* getcwd(char* buffer, size_t maxlen);
extern (C) char* _getcwd(char* buffer, size_t maxlen);
alias getcwd = _getcwd;
} else {
import core.sys.posix.unistd : getcwd;
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dmd/root/filename.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ version (Windows)

extern (Windows) DWORD GetFullPathNameW(LPCWSTR, DWORD, LPWSTR, LPWSTR*) nothrow @nogc;
extern (Windows) void SetLastError(DWORD) nothrow @nogc;
extern (C) char* getcwd(char* buffer, size_t maxlen) nothrow;
extern (C) char* _getcwd(char* buffer, size_t maxlen) nothrow;
alias getcwd = _getcwd;
}

version (CRuntime_Glibc)
Expand Down

0 comments on commit dd05a55

Please sign in to comment.