Skip to content

Fix build with Clang on Window#926

Merged
LebedevRI merged 2 commits intodarktable-org:developfrom
stevenlr:fix_windows_clang_build
Dec 14, 2025
Merged

Fix build with Clang on Window#926
LebedevRI merged 2 commits intodarktable-org:developfrom
stevenlr:fix_windows_clang_build

Conversation

@stevenlr
Copy link
Copy Markdown
Contributor

This PR fixes two issues that made it impossible to build rawspeed on Windows with Clang (and probably MSVC too, though I have not tested that).

Note that I'm currently building the library without any of the external dependencies, and hence there could exist other problematic code paths that I'm not hitting.

@stevenlr stevenlr requested a review from LebedevRI as a code owner December 13, 2025 23:35
@github-actions
Copy link
Copy Markdown

The proposed diff is not clang-formatted.
To make this check pass, download the following patch
(via browser, you must be logged-in in order for this URL to work),
(NOTE: save it into the repo checkout dir for the snippet to work)
https://github.com/darktable-org/rawspeed/actions/runs/20199501530/artifacts/4861270675
... and run:

cd <path/to/repo/checkout> # NOTE: use your own path here
unzip clang-format.patch.zip
git stash # Temporairly stash away any preexisting diff
git apply clang-format.patch # Apply the diff
git add -u # Stage changed files
git commit -m "Applying clang-format" # Commit the patch
git push
git stash pop # Unstast preexisting diff
rm clang-format.patch.zip clang-format.patch

@LebedevRI
Copy link
Copy Markdown
Member

Please split commit in two and mention the actual error in each commit message.

@stevenlr stevenlr force-pushed the fix_windows_clang_build branch 2 times, most recently from bdf2e5f to 04e0e01 Compare December 14, 2025 15:06
@stevenlr
Copy link
Copy Markdown
Contributor Author

Done in latest revision.

@LebedevRI
Copy link
Copy Markdown
Member

@stevenlr please rebase

This created compilation issues where all SIMD intrinsics symbols were
not defined in the correct namespace.
In MSVC's STL, the std::array iterators are not simply the elements pointer,
and hence cannot be compared to them.

Instead we dereference the iterator and take its address for comparison.
@stevenlr stevenlr force-pushed the fix_windows_clang_build branch from 04e0e01 to 9fbee75 Compare December 14, 2025 19:21
@stevenlr
Copy link
Copy Markdown
Contributor Author

Done!

@LebedevRI LebedevRI merged commit 4794a93 into darktable-org:develop Dec 14, 2025
52 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants