Add FreeBSD compat layer for endian.h
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 21 Feb 2012 00:15:25 +0000 (19:15 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Feb 2012 22:27:24 +0000 (17:27 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@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 df8ab0b2b67a224bed60a9b86d866494a288f37f..61cb1805c8b71f7fb2e050b7eaebefd95a9762b3 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 2f00440bdc173dbced449363e252860c190cd178..2bbe785e6850e8c5c21bf54f6ad81011168bfb09 100644 (file)
@@ -24,7 +24,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 b67a15c67b51fef30683b99a0c929dffef06fcfb..e42b6de64314c914a1c67908f128e628bd2b1ad1 100644 (file)
@@ -10,7 +10,6 @@
 
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <endian.h>
 #include <urcu/list.h>
 #include <urcu/hlist.h>
 #include <pthread.h>
@@ -23,6 +22,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.02765 seconds and 4 git commands to generate.