From 2ae577586ce440e59acd37c0110b80a595a64d12 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 20 Feb 2012 19:15:25 -0500 Subject: [PATCH] Add FreeBSD compat layer for endian.h Signed-off-by: Mathieu Desnoyers --- include/Makefile.am | 1 + include/lttng/bitfield.h | 2 +- include/lttng/ust-endian.h | 29 +++++++++++++++++++++++++++++ include/lttng/ust-events.h | 2 +- liblttng-ust/jhash.h | 2 +- liblttng-ust/ltt-events.c | 2 +- 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 include/lttng/ust-endian.h diff --git a/include/Makefile.am b/include/Makefile.am index e339b32e..66b9ab0a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -13,6 +13,7 @@ nobase_include_HEADERS = \ lttng/ust-tracer.h \ lttng/ust-config.h \ lttng/ust.h \ + lttng/ust-endian.h \ lttng/ringbuffer-config.h \ lttng/align.h \ lttng/bug.h diff --git a/include/lttng/bitfield.h b/include/lttng/bitfield.h index df8ab0b2..61cb1805 100644 --- a/include/lttng/bitfield.h +++ b/include/lttng/bitfield.h @@ -21,7 +21,7 @@ #include /* C99 5.2.4.2 Numerical limits */ #include /* C99 5.2.4.2 Numerical limits */ -#include /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */ +#include /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */ #include /* We can't shift a int from 32 bit, >> 32 and << 32 on int is undefined */ diff --git a/include/lttng/ust-endian.h b/include/lttng/ust-endian.h new file mode 100644 index 00000000..085ff072 --- /dev/null +++ b/include/lttng/ust-endian.h @@ -0,0 +1,29 @@ +#ifndef _LTTNG_UST_ENDIAN_H +#define _LTTNG_UST_ENDIAN_H + +/* + * lttng/ust-endian.h + * + * Copyright 2012 (c) - Mathieu Desnoyers + * + * endian.h compatibility layer. + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program + * for any purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + */ + +#ifdef __linux__ +#include +#elif __FreeBSD__ +#include +#else +#error "Please add support for your OS into lttng/ust-endian.h." +#endif + +#endif /* _LTTNG_UST_ENDIAN_H */ diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 2f00440b..2bbe785e 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include struct ltt_channel; diff --git a/liblttng-ust/jhash.h b/liblttng-ust/jhash.h index 944dc047..da1e7dd0 100644 --- a/liblttng-ust/jhash.h +++ b/liblttng-ust/jhash.h @@ -17,7 +17,7 @@ */ #include -#include +#include /* * Hash function diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index b67a15c6..e42b6de6 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -10,7 +10,6 @@ #define _GNU_SOURCE #include -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include "clock.h" #include -- 2.34.1