From 73e0d9449ffd250dfe241737a962758674b6b1aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 10 Feb 2014 11:04:22 -0500 Subject: [PATCH] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Necessary to include the fixed-width type limits on glibc versions older than 2.18 when building with a C++ compiler. Acked-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau Signed-off-by: David Goulet --- include/lttng/lttng.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 18dec2a8a..f0be224b5 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -23,7 +23,17 @@ #define LTTNG_H #include +/* + * Necessary to include the fixed width type limits on glibc versions older + * than 2.18 when building with a C++ compiler. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#include +#undef __STDC_LIMIT_MACROS +#else /* #ifndef __STDC_LIMIT_MACROS */ #include +#endif /* #else #ifndef __STDC_LIMIT_MACROS */ #include /* Error codes that can be returned by API calls */ -- 2.34.1