tech-net archive

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

NetBSD-6: bpf_validate()/bpf_filter() duplicate declaration pcap.h pcap/bpf.h breaks C++



I'm trying to build the latest mongodb (C++ app) on NetBSD-6, and it
fails with the following error:

In file included from tools/sniffer.cpp:30:0:
/usr/include/pcap/bpf.h:382:8: error: previous declaration of 'u_int
bpf_filter(const bpf_insn*, const u_char*, u_int, u_int)' with 'C++'
linkage
/usr/include/pcap.h:354:71: error: conflicts with new declaration with
'C' linkage
/usr/include/pcap/bpf.h:381:6: error: previous declaration of 'int
bpf_validate(const bpf_insn*, int)' with 'C++' linkage
/usr/include/pcap.h:355:51: error: conflicts with new declaration with
'C' linkage

This seems to be because both /usr/include/pcap.h and
/usr/include/pcap/bpf.h declare:

int      bpf_validate(const struct bpf_insn *, int);
u_int    bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);

Since /usr/include/pcap.h includes /usr/include/pcap/bpf.h (#ifndef
PCAP_DONT_INCLUDE_PCAP_BPF_H)
is this really necessary, or even desirable?

Needless to say commenting out the duplicate declarations allows a
build to complete...

Is this a fault with NetBSD's includes?


Home | Main Index | Thread Index | Old Index