]> git.tuebingen.mpg.de Git - paraslash.git/commit
Avoid warning about sys/sysctl.h on glibc-2.30.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 20 Aug 2019 07:10:53 +0000 (09:10 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 1 Sep 2019 11:50:31 +0000 (13:50 +0200)
commitac1f19d550a81c8408c8fce2e237996c950253ab
treecd11e4a88ae312ec44fb9dd2ce772e21ea3741a2
parent05a15e80c5dae4f94c417210549d07a94a0acc16
Avoid warning about sys/sysctl.h on glibc-2.30.

From glibc-2.30 NEWS:

The Linux-specific <sys/sysctl.h> header and the sysctl function have
been deprecated and will be removed from a future version of glibc.

Compilation against the glibc-2.30 headers results in the following warning:

In file included from ipc.c:10:
/usr/include/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]

On NetBSD and FreeBSD, however, we still need to include the header
to get the declaration of sysctlbyname(3).

This patch changes ipc.c to include sys/sysctl.h only if __FreeBSD__ or
__NetBSD__ is defined.  Also remove the pointless check for __APPLE__.
ipc.c