Skip to content

Add PTHREAD_STACK_MIN fallback to macOS builds - #5

Merged
schikani merged 3 commits into
tinydesk-project:mainfrom
mendeni:tdsh_posix
Oct 13, 2026
Merged

schikani merged 3 commits into
tinydesk-project:mainfrom
mendeni:tdsh_posix

Conversation

@mendeni

@mendeni mendeni commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

PTHREAD_STACK_MIN is part of the POSIX threading standard, but is optional on macOS. Because this constant isn't defined, the compiler sees an undeclared identifier and throws an error.

This change adds a PTHREAD_STACK_MIN conditional to tdsh_posix.c so that macOS builds succeed.

@schikani

Copy link
Copy Markdown
Collaborator

Thanks for the fix, and welcome! It builds cleanly on Linux and all host tests pass.

One small request since you can test on macOS: POSIX defines PTHREAD_STACK_MIN in <limits.h>, which tdsh_posix.c never includes (on Linux it only arrives through <pthread.h>). Could you add #include <limits.h> with the other system headers and check whether macOS then defines it? If it does, it'll use the real value (16 KB on Apple Silicon, I believe), and your fallback can stay as a safety net for systems that still lack it.

I'll squash-merge once that's checked.

@mendeni

mendeni commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@schikani I was able to build on macOS without fallback lines and only #include <limits.h>.

I left the fallback in place as a safety net as you described.

edit: fixed and typo

@schikani
schikani merged commit c9bfbe1 into tinydesk-project:main Oct 13, 2026
4 checks passed
@schikani

Copy link
Copy Markdown
Collaborator

Thanks for checking on macOS and for the quick update! Merged.

@mendeni
mendeni deleted the tdsh_posix branch October 13, 2026 18:13
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