[v12,4/9] trace-cmd: Added implementation of htonll() and ntohll()
diff mbox series

Message ID 20190828085746.26231-5-tz.stoyanov@gmail.com
State Superseded
Headers show
  • trace-cmd: Timetamps sync between host and guest machines, relying on vsock events.
Related show

Commit Message

Tzvetomir Stoyanov Aug. 28, 2019, 8:57 a.m. UTC
From: Tzvetomir Stoyanov <tstoyanov@vmware.com>

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(+)

diff mbox series

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
+#define htonll(x) __bswap_64(x)
+#define ntohll(x) __bswap_64(x)
+#define htonll(x) (x)
+#define ntohll(x) (x)
 #endif /* _TRACE_MSG_H_ */