Get rid of sysctl includes on Linux.
authorAdam Borowski <kilobyte@angband.pl>
Tue, 13 Jan 2015 00:52:56 +0000 (01:52 +0100)
committerAdam Borowski <kilobyte@angband.pl>
Tue, 13 Jan 2015 00:52:56 +0000 (01:52 +0100)
The 'sysctl' syscall has been strongly deprecated on Linux for ages.
Currently, on old architectures it will spam syslog whenever used, and on
newer ones it's missing from the headers altogether.  Opencv has migrated
away on Linux already, but #includes were left lingering.  This commit
removes them on non-__APPLE__, unbreaking x32 (and probably others).

modules/core/src/parallel.cpp
modules/core/src/system.cpp
modules/videoio/src/cap_ffmpeg_impl.hpp

index 5a51230..1fb980d 100644 (file)
@@ -56,7 +56,7 @@
     #include <sys/types.h>
     #if defined ANDROID
         #include <sys/sysconf.h>
-    #else
+    #elif defined __APPLE__
         #include <sys/sysctl.h>
     #endif
 #endif
index d9a2087..1f9d686 100644 (file)
@@ -163,8 +163,6 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
 #include <sys/types.h>
 #if defined ANDROID
 #include <sys/sysconf.h>
-#else
-#include <sys/sysctl.h>
 #endif
 #endif
 
index bd967f9..5870f4b 100644 (file)
@@ -139,8 +139,10 @@ extern "C" {
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+#if defined __APPLE__
     #include <sys/sysctl.h>
 #endif
+#endif
 
 #ifndef MIN
 #define MIN(a, b) ((a) < (b) ? (a) : (b))