From 2c7dd8012db9f1b77ec5dd17ac5d16ebfb0ac1b4 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 17 Nov 2014 17:36:10 +0100 Subject: [PATCH] Fix: allow tracepoints to build with --std=c99 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 --- include/lttng/ust-endian.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/lttng/ust-endian.h b/include/lttng/ust-endian.h index f676162b..a512b02b 100644 --- a/include/lttng/ust-endian.h +++ b/include/lttng/ust-endian.h @@ -35,6 +35,22 @@ #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 -- 2.34.1