Fix: allow tracepoints to build with --std=c99
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Nov 2014 16:36:10 +0000 (17:36 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Nov 2014 16:37:42 +0000 (17:37 +0100)
std=c99 without #define __USE_BSD does not work for tracepoint header,
due to missing endianness macros. Force their definition in the
ust-endian.h wrapper if they are missing.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-endian.h

index f676162b067a1ec2f61bdf856e7a1d5402b62537..a512b02bf3719fc89f2126df72e5f46a5d93a194 100644 (file)
 #error "Please add support for your OS."
 #endif
 
+/*
+ * BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN are only defined on Linux
+ * if __USE_BSD is defined. Force their definition.
+ */
+#ifndef BYTE_ORDER
+#define BYTE_ORDER __BYTE_ORDER
+#endif
+
+#ifndef LITTLE_ENDIAN
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#endif
+
+#ifndef BIG_ENDIAN
+#define BIG_ENDIAN __BIG_ENDIAN
+#endif
+
 #ifndef FLOAT_WORD_ORDER
 #ifdef __FLOAT_WORD_ORDER
 #define FLOAT_WORD_ORDER       __FLOAT_WORD_ORDER
This page took 0.02539 seconds and 4 git commands to generate.