From 5ec17e610609b8ca80cf8ce4f33f8c03ea48a090 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Fri, 15 Jul 2016 12:46:53 +0200 Subject: [PATCH] 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. --- Source/cmNinjaNormalTargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 81a161838..1e8372243 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -374,7 +374,7 @@ static int calculateCommandLineLengthLimit(int linkRuleLength) #ifdef _WIN32 8000, #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 ((int)sysconf(_SC_ARG_MAX)) - 1000, #endif