Closed rsms closed 1 year ago
I found this, you should edit your PR with these changes
https://github.com/michaelforney/samurai/pull/82#issuecomment-1191554714
All the pull requests are closed, it's hard to tell what has been merged or not. I get the feeling there should be an alternate repo where stuff is merged, samurai-staging
perhaps
Iwas about to open a PR with this change, but this also applies to samu.c, it's enough to make the app compile on Haiku
#ifndef NO_GETLOADAVG
#if defined(__QNX__) || defined(__HAIKU__) || defined(_WIN32) || defined(MSDOS)
#define NO_GETLOADAVG 1
#endif
#endif
Perhaps there should be a special .h file, platform.h
where compatibility issues are addressed in a more verbose way
I would really like to avoid this sort of ifdef. This is why I was hesitant to merge getloadavg support in the first place.
Instead, I made it default to disabled in c16d4501153512d87aaed43513189b3d1de5c14d. Those that want it can define '-D HAVE_GETLOADAVG` along with whatever else is needed for their system.
On darwin/macos, stdlib.h guards the definition of getloadavg with
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) ... #endif
.Without this change samurai doesn't build on darwin (without
-DNO_GETLOADAVG
), e.g:Thanks for an elegant ninja implementation!