From: Mathieu Desnoyers Date: Mon, 17 Nov 2014 16:36:10 +0000 (+0100) Subject: Fix: allow tracepoints to build with --std=c99 X-Git-Tag: v2.6.0-rc3~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2c7dd8012db9f1b77ec5dd17ac5d16ebfb0ac1b4;p=lttng-ust.git 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 --- 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