Skip to content

Commit a64f517

Browse files
authored
Testing: fix Windows specific code for application data (#110)
The parameter is expected to be `KNOWNFOLDERID` which is a `Optional<UnsafePointer<GUID>>`. Additionally, correct the spelling of `NULL` to `nil`. This allows the target to build on Windows.
1 parent 0ae83a1 commit a64f517

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Testing/Traits/Tag.Color+Loading.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ private var _homeDirectoryPath: String? {
3636
/// The path to the current user's App Data directory, if known.
3737
private var _appDataDirectoryPath: String? {
3838
var appDataDirectoryPath: PWSTR? = nil
39-
if S_OK == SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &appDataDirectoryPath), let appDataDirectoryPath {
39+
var FOLDERID_LocalAppData = FOLDERID_LocalAppData
40+
if S_OK == SHGetKnownFolderPath(&FOLDERID_LocalAppData, 0, nil, &appDataDirectoryPath), let appDataDirectoryPath {
4041
defer {
4142
CoTaskMemFree(appDataDirectoryPath)
4243
}

0 commit comments

Comments
 (0)