[Linux] Avoid usage of <sys/sysctl.h> in MallocBench
https://bugs.webkit.org/show_bug.cgi?id=203109

Reviewed by Carlos Alberto Lopez Perez.

* MallocBench/MallocBench/CPUCount.cpp: Only include <sys/sysctl.h> if
the sysctl() function will be used.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog
index fc9385d..fe4d355 100644
--- a/PerformanceTests/ChangeLog
+++ b/PerformanceTests/ChangeLog
@@ -1,3 +1,13 @@
+2019-10-17  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [Linux] Avoid usage of <sys/sysctl.h> in MallocBench
+        https://bugs.webkit.org/show_bug.cgi?id=203109
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * MallocBench/MallocBench/CPUCount.cpp: Only include <sys/sysctl.h> if
+        the sysctl() function will be used.
+
 2019-10-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Perf test IndexedDB/basic/index-cursor-delete.html timeouts
diff --git a/PerformanceTests/MallocBench/MallocBench/CPUCount.cpp b/PerformanceTests/MallocBench/MallocBench/CPUCount.cpp
index 31d6d2d..f2433d7 100644
--- a/PerformanceTests/MallocBench/MallocBench/CPUCount.cpp
+++ b/PerformanceTests/MallocBench/MallocBench/CPUCount.cpp
@@ -26,10 +26,13 @@
 #include "CPUCount.h"
 #include <stdlib.h>
 #include <sys/param.h>
-#include <sys/sysctl.h>
 #include <sys/types.h>
 #include <unistd.h>
 
+#ifdef __APPLE__
+#include <sys/sysctl.h>
+#endif
+
 static size_t count;
 
 size_t cpuCount()