Skip to content

InfiniteColorEngineRgbw.cpp: add missing cstring include - #1489

Merged
awawa-dev merged 4 commits into
awawa-dev:fix_build_without_pchfrom
HiassofT:include-fix
Mar 30, 2026
Merged

awawa-dev merged 4 commits into
awawa-dev:fix_build_without_pchfrom
HiassofT:include-fix

Conversation

@HiassofT

Copy link
Copy Markdown

This fixes a build error found on LibreELEC master:

error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

This fixes a build error found on LibreELEC master:

error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?

Signed-off-by: Matthias Reichl <[email protected]>
@awawa-dev

Copy link
Copy Markdown
Owner

Ok, thanks. But is there a reason why you disable PCH when compiling HyperHDR?

@HiassofT

Copy link
Copy Markdown
Author

I'm not a fan of precompiled headers, from my experience they cause more problems than they solve.

eg they don't play nice with ccache and result in 2.5x rebuild time with populated ccache (10s without PCH, 25s with PCH)

@awawa-dev

Copy link
Copy Markdown
Owner

PCH has been around for many years, and ccache has recently made a huge leap in supporting it. But it needs a special option enabled, as noted in its documentation:

  1. Compilation time shows an advantage in most systems (a few has shown even significant difference) when using PCH compared to disabling it (with ccache enabled in both cases):
    https://github.com/awawa-dev/HyperHDR/actions/runs/23450165809 vs https://github.com/awawa-dev/HyperHDR/actions/runs/23448839883

I performed few compilation runs to stabilize ccache.

  1. There is a problem with the legacy ws2811 library. Currently, on some systems, enabling PCH is the only way to successfully compile (to precompile C++20 headers separately); otherwise, it fails like this: https://github.com/awawa-dev/HyperHDR/actions/runs/23448465968/job/68218800978

So, in order to have the possibility of disabling PCH we need both things handled somehow. However, the issue in that external legacy library hasn't been fixed for years. I think I'll another PR to handle them or to remove possibility to disable PCH completely.

@HiassofT

Copy link
Copy Markdown
Author

We haven't seen such build issues with rpi_ws2812 on LibreELEC yet.

We're pretty much bleeding edge on everything, except Qt, which is still on 5.15.16 (Qt6 is a bitch to build) - that might be the difference to the build issue you linked.

rpi_ws2812 has other issues though, it's cmake_minimum_required(VERSION 3.0.0) breaks build with cmake 4 and needs -DCMAKE_POLICY_VERSION_MINIMUM=3.5 or similar workarounds like patching.

rpi_ws2812 issues, precompiled headers, and the bugfix in this PR are completely separate things though.

Using std::memcpy without the cstring include is clearly a bug in this code.

I'd prefer if precompiled headers stay an optional feature, you are free to enable it by default if you like but it can hide include issues like this one - so it's always good to check in CI if build without precompiled headers works, too.

@awawa-dev

awawa-dev commented Mar 23, 2026 •

Copy link
Copy Markdown
Owner

That ws2811 library hasnt been changed for a few years, but HyperHDR has switched to c++20 and there is a conflict with #include <version> from c++20 and that library's version file. Probably if you compile the library as a separate module without c++20, the bug wont appear. Otherwise for our project PCH is our only mandatory workaround for now.

@HiassofT

HiassofT commented Mar 23, 2026 •

Copy link
Copy Markdown
Author

We're not compiling separately.

BTW the Qt6 version bug has been fixed in the rpi_ws2812 hyperion repo about a year ago hyperion-project/rpi_ws281x@4446db6

Maybe switch rpi_ws2812 (back) to the hyperion repo...

@awawa-dev

Copy link
Copy Markdown
Owner

No, thats not an option

@awawa-dev
awawa-dev changed the base branch from master to fix_build_without_pch March 30, 2026 20:27
@awawa-dev
awawa-dev merged commit c53e30c into awawa-dev:fix_build_without_pch Mar 30, 2026
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