*
* This is the same as the count of trailing zeroes in the word.
*/
-#if PCAP_IS_AT_LEAST_GNUC_VERSION(3, 4)
+#if PCAP_IS_AT_LEAST_GNUC_VERSION(3,4)
/*
* GCC 3.4 and later; we have __builtin_ctz().
*/
#define lowest_set_bit(mask) __builtin_ctz(mask)
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif defined(_MSC_VER)
/*
- * Visual Studio 2005 and later; use _BitScanForward().
+ * Visual Studio; we support only 2005 and later, so use
+ * _BitScanForward().
*/
#include <intrin.h>
#pragma intrinsic(_BitScanForward)
p->fcode.bf_len = fp->bf_len;
p->fcode.bf_insns = (struct bpf_insn *)malloc(prog_size);
if (p->fcode.bf_insns == NULL) {
- pcap_snprintf(p->errbuf, sizeof(p->errbuf),
- "malloc: %s", pcap_strerror(errno));
+ pcap_fmt_errmsg_for_errno(p->errbuf, sizeof(p->errbuf),
+ errno, "malloc");
return (-1);
}
memcpy(p->fcode.bf_insns, fp->bf_insns, prog_size);