make this code compile in userspace on OSX

This commit is contained in:
Luigi Rizzo 2013-11-22 05:00:18 +00:00
parent 413c8aaa87
commit d0f65d47ec

View File

@ -85,8 +85,15 @@ __FBSDID("$FreeBSD$");
#define ICMP(p) ((struct icmphdr *)(p))
#define ICMP6(p) ((struct icmp6_hdr *)(p))
#ifdef __APPLE__
#undef snprintf
#define snprintf sprintf
#define SNPARGS(buf, len) buf + len
#define SNP(buf) buf
#else /* !__APPLE__ */
#define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0
#define SNP(buf) buf, sizeof(buf)
#endif /* !__APPLE__ */
#ifdef WITHOUT_BPF
void