tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add <sys/sysctl.h> early as possible (upcoming mesa 17.0.0)

Reminder: If you are patching a port by adding
#include <sys/sysctl.h>
then add this as soon as possible.  DO NOT under any
circumstances add this after local includes.

The reason is as follows.  NetBSD's version of
sys/sysctl.h includes sys/param.h.  sys.param.h defines
ALIGN as a one-parameter macro.

Suppose you decide to ignore this advice.  One day a
port, let's call it the upcoming mesa 17.0.0 (it's really
13.1.0, the mesa3D people just decided to start versioning
their software by year), will decide to cleverly define
its own version of ALIGN with two arguments.  And this
new version of ALIGN will have a helpful include guard.
But fortunately it undefs ALIGN before it redefines it.

So just include sys/sysctl.h as soon as possible.

Home | Main Index | Thread Index | Old Index