Add FreeBSD compat layer for endian.h
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 21 Feb 2012 00:15:25 +0000 (19:15 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Tue, 27 Nov 2012 19:17:19 +0000 (14:17 -0500)
commit 2ae577586ce440e59acd37c0110b80a595a64d12 upstream.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
include/Makefile.am
include/lttng/bitfield.h
include/lttng/ust-endian.h [new file with mode: 0644]
include/lttng/ust-events.h
liblttng-ust/jhash.h
liblttng-ust/ltt-events.c

index e339b32e74d11e85823580478136282928c618cb..66b9ab0a043e6798768384d5bfa736e5780a50fe 100644 (file)
@@ -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
index 9bef7e3c32747b13cadfcee6a8acbd36f51a5a83..c3f2d1ace18b97537212f55d8a3f898022da6139 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <stdint.h>    /* C99 5.2.4.2 Numerical limits */
 #include <limits.h>    /* C99 5.2.4.2 Numerical limits */
-#include <endian.h>    /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */
+#include <lttng/ust-endian.h>  /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */
 #include <assert.h>
 
 /* 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 (file)
index 0000000..085ff07
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _LTTNG_UST_ENDIAN_H
+#define _LTTNG_UST_ENDIAN_H
+
+/*
+ * lttng/ust-endian.h
+ *
+ * Copyright 2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * 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 <endian.h>
+#elif __FreeBSD__
+#include <machine/endian.h>
+#else
+#error "Please add support for your OS into lttng/ust-endian.h."
+#endif
+
+#endif /* _LTTNG_UST_ENDIAN_H */
index bf00f062482b154695e2579f7c0538537e55854c..251c0fb655f1167e6899269a344ac82eaddda686 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdint.h>
 #include <lttng/ust-abi.h>
 #include <lttng/ust-tracer.h>
-#include <endian.h>
+#include <lttng/ust-endian.h>
 #include <float.h>
 
 struct ltt_channel;
index 944dc0471fb3d5a90d0f54d9e516d61f377f6f5b..da1e7dd02c7b994bbdda9e5f8f7ce6eae27d4f5b 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 #include <urcu/compiler.h>
-#include <endian.h>
+#include <lttng/ust-endian.h>
 
 /*
  * Hash function
index d2c922b603d2f78342e127c0d26e1bf771d673df..775e73cad828f5119a8b3275b4f86470d55d07b9 100644 (file)
@@ -22,7 +22,6 @@
 
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <endian.h>
 #include <urcu/list.h>
 #include <urcu/hlist.h>
 #include <pthread.h>
@@ -35,6 +34,7 @@
 #include <inttypes.h>
 #include <time.h>
 #include <sys/prctl.h>
+#include <lttng/ust-endian.h>
 #include "clock.h"
 
 #include <urcu-bp.h>
This page took 0.027446 seconds and 4 git commands to generate.