Skip to content

fix std.os.windows.PathFileExists specified in the wrong DLL #1066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion std/os/file.zig
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ pub const File = struct {
}
return true;
} else if (is_windows) {
if (os.windows.PathFileExists(path_with_null.ptr) == os.windows.TRUE) {
// TODO do not depend on shlwapi.dll
if (os.windows.PathFileExistsA(path_with_null.ptr) == os.windows.TRUE) {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions std/os/windows/index.zig
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ pub extern "kernel32" stdcallcc fn QueryPerformanceCounter(lpPerformanceCount: *

pub extern "kernel32" stdcallcc fn QueryPerformanceFrequency(lpFrequency: *LARGE_INTEGER) BOOL;

pub extern "kernel32" stdcallcc fn PathFileExists(pszPath: ?LPCTSTR) BOOL;

pub extern "kernel32" stdcallcc fn ReadFile(
in_hFile: HANDLE,
out_lpBuffer: *c_void,
Expand Down Expand Up @@ -163,6 +161,8 @@ pub extern "kernel32" stdcallcc fn FreeLibrary(hModule: HMODULE) BOOL;

pub extern "user32" stdcallcc fn MessageBoxA(hWnd: ?HANDLE, lpText: ?LPCTSTR, lpCaption: ?LPCTSTR, uType: UINT) c_int;

pub extern "shlwapi" stdcallcc fn PathFileExistsA(pszPath: ?LPCTSTR) BOOL;

pub const PROV_RSA_FULL = 1;

pub const BOOL = c_int;
Expand Down