diff options
Diffstat (limited to 'source/Host/windows/Windows.cpp')
-rw-r--r-- | source/Host/windows/Windows.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/source/Host/windows/Windows.cpp b/source/Host/windows/Windows.cpp index 21afc6d85da5..9d0e70e6d126 100644 --- a/source/Host/windows/Windows.cpp +++ b/source/Host/windows/Windows.cpp @@ -23,13 +23,6 @@ #include <stdlib.h> #include <string.h> -// These prototypes are defined in <direct.h>, but it also defines chdir() and -// getcwd(), giving multiply defined errors -extern "C" { -char *_getcwd(char *buffer, int maxlen); -int _chdir(const char *path); -} - namespace { bool utf8ToWide(const char *utf8, wchar_t *buf, size_t bufSize) { const llvm::UTF8 *sourceStart = reinterpret_cast<const llvm::UTF8 *>(utf8); @@ -190,31 +183,6 @@ char *basename(char *path) { return &l1[1]; } -// use _getcwd() instead of GetCurrentDirectory() because it updates errno -char *getcwd(char *path, int max) { - assert(path == NULL || max <= PATH_MAX); - wchar_t wpath[PATH_MAX]; - if (wchar_t *wresult = _wgetcwd(wpath, PATH_MAX)) { - // Caller is allowed to pass in NULL for `path`. - // In that case, we're supposed to allocate a - // buffer on the caller's behalf. - if (path == NULL) { - max = UNI_MAX_UTF8_BYTES_PER_CODE_POINT * wcslen(wresult) + 1; - path = (char *)malloc(max); - if (path == NULL) { - errno = ENOMEM; - return NULL; - } - } - if (wideToUtf8(wresult, path, max)) - return path; - } - return NULL; -} - -// use _chdir() instead of SetCurrentDirectory() because it updates errno -int chdir(const char *path) { return _chdir(path); } - char *dirname(char *path) { char *l1 = strrchr(path, '\\'); char *l2 = strrchr(path, '/'); |