Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 4f4e6cc

Browse files
author
David Major
committed
Bug 1316120: Fix nsLocalFileWin.cpp build on clang-cl. r=froydnj
This keeps the ITEMIDLIST pointers in the "LP" flavour to avoid casting away __unaligned qualifiers. __unaligned is meaningless on non-Itanium platforms but clang-cl nonetheless has trouble with it. (https://llvm.org/bugs/show_bug.cgi?id=30578)
1 parent a83c3a8 commit 4f4e6cc

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

xpcom/io/nsLocalFileWin.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,12 @@ class AsyncRevealOperation : public Runnable
180180
HRESULT hr;
181181
if (attributes & FILE_ATTRIBUTE_DIRECTORY) {
182182
// We have a directory so we should open the directory itself.
183-
ITEMIDLIST* dir =
184-
static_cast<ITEMIDLIST*>(ILCreateFromPathW(mResolvedPath.get()));
183+
LPITEMIDLIST dir = ILCreateFromPathW(mResolvedPath.get());
185184
if (!dir) {
186185
return NS_ERROR_FAILURE;
187186
}
188187

189-
const ITEMIDLIST* selection[] = { dir };
188+
LPCITEMIDLIST selection[] = { dir };
190189
UINT count = ArrayLength(selection);
191190

192191
//Perform the open of the directory.
@@ -204,21 +203,19 @@ class AsyncRevealOperation : public Runnable
204203
PathRemoveFileSpecW(parentDirectoryPath);
205204

206205
// We have a file so we should open the parent directory.
207-
ITEMIDLIST* dir =
208-
static_cast<ITEMIDLIST*>(ILCreateFromPathW(parentDirectoryPath));
206+
LPITEMIDLIST dir = ILCreateFromPathW(parentDirectoryPath);
209207
if (!dir) {
210208
return NS_ERROR_FAILURE;
211209
}
212210

213211
// Set the item in the directory to select to the file we want to reveal.
214-
ITEMIDLIST* item =
215-
static_cast<ITEMIDLIST*>(ILCreateFromPathW(mResolvedPath.get()));
212+
LPITEMIDLIST item = ILCreateFromPathW(mResolvedPath.get());
216213
if (!item) {
217214
CoTaskMemFree(dir);
218215
return NS_ERROR_FAILURE;
219216
}
220217

221-
const ITEMIDLIST* selection[] = { item };
218+
LPCITEMIDLIST selection[] = { item };
222219
UINT count = ArrayLength(selection);
223220

224221
//Perform the selection of the file.

0 commit comments

Comments
 (0)