X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Funix-formats.c;h=7059686555b798e98e8635b2cda106346ac1d39c;hb=ce815deb72fd3941b000aecec931131afc9d6c34;hp=b3b8c899d70c2cc5bfc6a16484dae2a306482f21;hpb=926b564d650700213f40b03394fdb12e45496246;p=vpp.git diff --git a/src/vppinfra/unix-formats.c b/src/vppinfra/unix-formats.c index b3b8c899d70..7059686555b 100644 --- a/src/vppinfra/unix-formats.c +++ b/src/vppinfra/unix-formats.c @@ -37,11 +37,17 @@ #ifdef __KERNEL__ +#if __linux__ # include # include +#endif #else /* ! __KERNEL__ */ +#ifdef __APPLE__ +#define _XOPEN_SOURCE +#endif + #define _GNU_SOURCE /* to get REG_* in ucontext.h */ #include #undef _GNU_SOURCE @@ -57,12 +63,14 @@ #include #include +#if __linux__ #include #ifdef AF_NETLINK #include #include #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 *); @@ -803,11 +812,11 @@ u8 * format_timeval (u8 * s, va_list * args) break; case 'm': what = tm->tm_mon + 1; - what_fmt = "%2d"; + what_fmt = "%02d"; break; case 'd': what = tm->tm_mday; - what_fmt = "%2d"; + what_fmt = "%02d"; break; case 'H': what = tm->tm_hour; @@ -832,6 +841,7 @@ u8 * format_timeval (u8 * s, va_list * args) return s; } +#endif u8 * format_time_float (u8 * s, va_list * args) {