Skip to content

Commit 61936eb

Browse files
kilobyteLuke Petre
authored andcommitted
Get rid of sysctl includes on Linux.
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).
1 parent d856604 commit 61936eb

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

modules/core/src/parallel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include <sys/types.h>
5757
#if defined ANDROID
5858
#include <sys/sysconf.h>
59-
#else
59+
#elif defined __APPLE__
6060
#include <sys/sysctl.h>
6161
#endif
6262
#endif

modules/core/src/system.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
163163
#include <sys/types.h>
164164
#if defined ANDROID
165165
#include <sys/sysconf.h>
166-
#else
167-
#include <sys/sysctl.h>
168166
#endif
169167
#endif
170168

modules/highgui/src/cap_ffmpeg_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ extern "C" {
129129
#include <unistd.h>
130130
#include <stdio.h>
131131
#include <sys/types.h>
132-
#include <sys/sysctl.h>
133132
#include <sys/time.h>
134133
#if defined __APPLE__
134+
#include <sys/sysctl.h>
135135
#include <mach/clock.h>
136136
#include <mach/mach.h>
137137
#endif

0 commit comments

Comments
 (0)