Fix builds on BSD host systems

This commit is contained in:
Mark Pizzolato 2011-11-26 08:21:45 -08:00
parent d9f3b66bbf
commit cbcd244e0c
2 changed files with 6 additions and 1 deletions

View file

@ -61,7 +61,7 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
endif endif
else else
LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g')
ifneq (,$(LDSEARCH) ifneq (,$(LDSEARCH))
LIBPATH := $(LDSEARCH) LIBPATH := $(LDSEARCH)
endif endif
ifeq (usrpkglib,$(shell if $(TEST) -d /usr/pkg/lib; then echo usrpkglib; fi)) ifeq (usrpkglib,$(shell if $(TEST) -d /usr/pkg/lib; then echo usrpkglib; fi))

View file

@ -961,7 +961,12 @@ void pcap_close(pcap_t* a) {
} }
} }
/* OpenBSD has an ancient declaration of pcap_compile which doesn't have a const in the bpf string argument */
#if defined (__OpenBSD__)
int pcap_compile(pcap_t* a, struct bpf_program* b, char* c, int d, bpf_u_int32 e) {
#else
int pcap_compile(pcap_t* a, struct bpf_program* b, const char* c, int d, bpf_u_int32 e) { int pcap_compile(pcap_t* a, struct bpf_program* b, const char* c, int d, bpf_u_int32 e) {
#endif
if (load_pcap() != 0) { if (load_pcap() != 0) {
return p_pcap_compile(a, b, c, d, e); return p_pcap_compile(a, b, c, d, e);
} else { } else {