summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/unix-formats.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-03 12:30:36 +0200
committerDamjan Marion <dmarion@me.com>2018-09-03 16:51:40 +0000
commit4dffd1c9988020619caff9b8d3b350e7f79e0398 (patch)
tree58d6b48f3925e815b68dfe04d3946c80ad1c24a1 /src/vppinfra/unix-formats.c
parentea5b5be4eeb0f4cd80cb466bd6e31cad33c57960 (diff)
Compile vppinfra on macOS
Add missing calls to clib_mem_init to vppinfra test codes. Change-Id: I53ffc6fc287d1a378065bb86c18b6e995ecdb775 Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/unix-formats.c')
-rw-r--r--src/vppinfra/unix-formats.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vppinfra/unix-formats.c b/src/vppinfra/unix-formats.c
index b3b8c899d70..c4473299563 100644
--- a/src/vppinfra/unix-formats.c
+++ b/src/vppinfra/unix-formats.c
@@ -37,11 +37,17 @@
#ifdef __KERNEL__
+#if __linux__
# include <linux/unistd.h>
# include <linux/signal.h>
+#endif
#else /* ! __KERNEL__ */
+#ifdef __APPLE__
+#define _XOPEN_SOURCE
+#endif
+
#define _GNU_SOURCE /* to get REG_* in ucontext.h */
#include <ucontext.h>
#undef _GNU_SOURCE
@@ -57,12 +63,14 @@
#include <math.h>
#include <vppinfra/time.h>
+#if __linux__
#include <vppinfra/linux/syscall.h>
#ifdef AF_NETLINK
#include <linux/types.h>
#include <linux/netlink.h>
#endif
+#endif
#endif /* ! __KERNEL__ */
@@ -277,6 +285,7 @@ u8 * format_sockaddr (u8 * s, va_list * args)
return s;
}
+#ifndef __APPLE__
u8 * format_tcp4_packet (u8 * s, va_list * args)
{
u8 * p = va_arg (*args, u8 *);
@@ -832,6 +841,7 @@ u8 * format_timeval (u8 * s, va_list * args)
return s;
}
+#endif
u8 * format_time_float (u8 * s, va_list * args)
{