Ninja: Generalize check for sysconf(3) call

Use `sysconf(_SC_ARG_MAX)` wherever `_SC_ARG_MAX` is available instead
of hard-coding an incomplete list of operating systems that implement
it.  In particular, it is available on BSD platforms that were not
previously listed.
This commit is contained in:
Raphael Kubo da Costa 2016-07-15 12:46:53 +02:00 committed by Brad King
parent c8e59d2dfa
commit 5ec17e6106
1 changed files with 1 additions and 1 deletions

View File

@ -374,7 +374,7 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
#ifdef _WIN32 #ifdef _WIN32
8000, 8000,
#endif #endif
#if defined(__APPLE__) || defined(__HAIKU__) || defined(__linux) #if defined(_SC_ARG_MAX)
// for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
((int)sysconf(_SC_ARG_MAX)) - 1000, ((int)sysconf(_SC_ARG_MAX)) - 1000,
#endif #endif