From: Guy Harris Date: Thu, 27 Nov 2014 21:13:34 +0000 (-0800) Subject: Partially fix building on QNX 6.5. X-Git-Tag: libpcap-1.7.2^2~93 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/9bad9f1dd01a1523693312fba7cb2f1b46c09f6b Partially fix building on QNX 6.5. From GitHub pull request #394; that was requested as a pull to the old 1.2 branch, not the trunk. I also updated comments to reflect the changes. --- diff --git a/pcap/bpf.h b/pcap/bpf.h index 48805087..8b116cd9 100644 --- a/pcap/bpf.h +++ b/pcap/bpf.h @@ -59,7 +59,8 @@ * or Tru64 UNIX-style multiple-include protection (or, at least, * Tru64 UNIX 5.x-style; I don't have earlier versions available to check), * or AIX-style multiple-include protection (or, at least, AIX 5.x-style; - * I don't have earlier versions available to check). + * I don't have earlier versions available to check), or QNX-style + * multiple-include protection (as per GitHub pull request #394). * * We do not check for BPF_MAJOR_VERSION, as that's defined by * , which is directly or indirectly included in some @@ -68,7 +69,7 @@ * * This also provides our own multiple-include protection. */ -#if !defined(_NET_BPF_H_) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h) +#if !defined(_NET_BPF_H_) && !defined(_NET_BPF_H_INCLUDED) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h) #define lib_pcap_bpf_h #ifdef __cplusplus diff --git a/pcap/pcap.h b/pcap/pcap.h index 7e1f2cd2..e4a42603 100644 --- a/pcap/pcap.h +++ b/pcap/pcap.h @@ -424,13 +424,13 @@ void pcap_freealldevs(pcap_if_t *); const char *pcap_lib_version(void); /* - * On at least some versions of NetBSD, we don't want to declare + * On at least some versions of NetBSD and QNX, we don't want to declare * bpf_filter() here, as it's also be declared in , with a * different signature, but, on other BSD-flavored UN*Xes, it's not * declared in , so we *do* want to declare it here, so it's * declared when we build pcap-bpf.c. */ -#ifndef __NetBSD__ +#if !defined(__NetBSD__) && !defined(__QNX__) u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); #endif int bpf_validate(const struct bpf_insn *f, int len);