Message ID | 20190308134423.22008-5-tstoyanov@vmware.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | trace-cmd: Timetamps sync between host and guest machines, relying on vsock events. | expand |
diff --git a/tracecmd/include/trace-msg.h b/tracecmd/include/trace-msg.h index b7fe10b..445f799 100644 --- a/tracecmd/include/trace-msg.h +++ b/tracecmd/include/trace-msg.h @@ -15,4 +15,14 @@ extern unsigned int page_size; void plog(const char *fmt, ...); void pdie(const char *fmt, ...); +#ifndef htonll +# if __BYTE_ORDER == __LITTLE_ENDIAN +#define htonll(x) __bswap_64(x) +#define ntohll(x) __bswap_64(x) +#else +#define htonll(x) (x) +#define ntohll(x) (x) +#endif +#endif + #endif /* _TRACE_MSG_H_ */
Added implementation of htonll() and ntohll() as macros, if they are not already defined. Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com> --- tracecmd/include/trace-msg.h | 10 ++++++++++ 1 file changed, 10 insertions(+)