Hi,
trying to compile a program of mine on FreeBSD that needs to figure out
the value of PF_TABLE_NAME_SIZE from pfvar.h fails with the following
errors:
line 368:34: "not" may not appear in macro parameter list
line 396: unexpected unqualified-id before `!' token
I can't make heads or tails out of those, and it works just fine on
OpenBSD (3.6 to -current). It may be worth noting that my program is
written in C++ and that FBSD's compiler is 3.4.something (.2, iirc). I
also think that I have the prerequesite headers figured out (I am
testing this with autoconf). The relevant parts of my configure.in look
like this:
[...]
AC_CHECK_HEADERS([net/pfvar.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
# if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# endif
# if HAVE_NET_IF_H
# include <net/if.h>
# endif
])
[...]
In plain english, this means that the test program does
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/pfvar.h>
I get the same errors when #include'ing all of those directly in my program.
It might be half-reasonable to hardcode the maximum length of a table to
32 characters, but I'd rather not do that (unless I can get the
confirmation that hell has to freeze over twice before
PF_TABLE_NAME_SIZE is going to be anything but 32 on any OS that comes
with pf).
Right now, I just hope that I'm missing one or more prerequesite
header(s) and/or some #define. Any insight would be highly appreciated!
Thanks in advance,
Moritz