From 67fef36a9b4c32b0ac1687b502df3a9d859d2389 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 13 Nov 2023 06:57:22 -0800 Subject: [PATCH] Testing: fix Windows specific code for application data The parameter is expected to be `KNOWNFOLDERID` which is a `Optional>`. Additionally, correct the spelling of `NULL` to `nil`. This allows the target to build on Windows. --- Sources/Testing/Traits/Tag.Color+Loading.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Testing/Traits/Tag.Color+Loading.swift b/Sources/Testing/Traits/Tag.Color+Loading.swift index 8dcb22234..06650c9ee 100644 --- a/Sources/Testing/Traits/Tag.Color+Loading.swift +++ b/Sources/Testing/Traits/Tag.Color+Loading.swift @@ -36,7 +36,8 @@ private var _homeDirectoryPath: String? { /// The path to the current user's App Data directory, if known. private var _appDataDirectoryPath: String? { var appDataDirectoryPath: PWSTR? = nil - if S_OK == SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &appDataDirectoryPath), let appDataDirectoryPath { + var FOLDERID_LocalAppData = FOLDERID_LocalAppData + if S_OK == SHGetKnownFolderPath(&FOLDERID_LocalAppData, 0, nil, &appDataDirectoryPath), let appDataDirectoryPath { defer { CoTaskMemFree(appDataDirectoryPath) }