Skip to content

On FreeBSD 12 sys/sysctl.h requires sys/types.h

Build failure on FreeBSD 12 (and perhaps earlier releases) unless #include <sys/sysctl.h> is preceded by #include <sys/types.h>. Else ExecutablePath.hsc fails to compile, because sysctl.h uses u_int defined in types.h:

In file included from ExecutablePath.hsc:42:
/usr/include/sys/sysctl.h:1062:25: error: unknown type name 'u_int'; did you mean 'int'?
 int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
compiling libraries/base/dist-install/build/System/Environment/ExecutablePath_hsc_make.c failed (exit code 1)

Merge request reports