From: Mathieu Desnoyers Date: Mon, 17 Nov 2014 16:36:10 +0000 (+0100) Subject: Fix: allow tracepoints to build with --std=c99 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=484fc1933b3f9d009298b276835b018f6391b475;p=deliverable%2Flttng-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