Skip to content

fix nob_nprocs build on FreeBSD/BSD under -std=c99 - #279

Open
SpartanSf wants to merge 2 commits into
tsoding:mainfrom
SpartanSf:main
Open

SpartanSf wants to merge 2 commits into
tsoding:mainfrom
SpartanSf:main

Conversation

@SpartanSf

Copy link
Copy Markdown

to reproduce issue fixed here:

  • cc -std=c99 -O2 -Wall -Wextra -o nob nob.c on FreeBSD (i specifically tested 14.5, applies almost anywhere though)

root cause:

  • non-POSIX sysconf name hidden

fix:

  • guard + hw.ncpu fallback, tested (Linux gcc/clang clean, works on BSD)

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.

1 participant