Skip to content

add linux/stddef.h for musl compatibility#175

Open
qaqland wants to merge 1 commit intowlrfx:mainfrom
qaqland:musl-header
Open

add linux/stddef.h for musl compatibility#175
qaqland wants to merge 1 commit intowlrfx:mainfrom
qaqland:musl-header

Conversation

@qaqland
Copy link
Copy Markdown
Contributor

@qaqland qaqland commented Mar 2, 2026

The __always_inline macro is defined in <linux/stddef.h>. While glibc includes this by default, musl does not. This commit explicitly includes <linux/stddef.h> to ensure compatibility with musl libc platforms.

In file included from ../tinywl/tinywl.c:8:
../include/scenefx/types/fx/clipped_region.h:18:8: error: unknown type name '__always_inline'
   18 | static __always_inline uint16_t corner_radius_clamp(int radius) {
      |        ^~~~~~~~~~~~~~~

The __always_inline macro is defined in <linux/stddef.h>. While glibc
includes this by default, musl does not. This commit explicitly includes
<linux/stddef.h> to ensure compatibility with musl libc platforms.

In file included from ../tinywl/tinywl.c:8:
../include/scenefx/types/fx/clipped_region.h:18:8: error: unknown type name '__always_inline'
   18 | static __always_inline uint16_t corner_radius_clamp(int radius) {
      |        ^~~~~~~~~~~~~~~
@ErikReider
Copy link
Copy Markdown
Member

Could you move all the needed changes into #174 so that everything musl related is in one PR?

@ErikReider ErikReider closed this Mar 2, 2026
@ErikReider
Copy link
Copy Markdown
Member

Oh wait sorry, that PR isn't musl related. My bad

@ErikReider ErikReider reopened this Mar 2, 2026
@ErikReider
Copy link
Copy Markdown
Member

Testing in an alpine:edge docker container, I'm also getting use of undeclared identifier 'unreachable'. Are you also experiencing this?

@qaqland
Copy link
Copy Markdown
Contributor Author

qaqland commented Mar 2, 2026

Yes, I met it too. I'm a bit hesitant about this problem. 'unreachable' is a standard function content of C231, however musl currently does not have it. This is not a problem with the scenefx project but with musl2.

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