From: Jérémie Galarneau Date: Mon, 10 Feb 2014 16:04:22 +0000 (-0500) Subject: Fix: Define __STDC_LIMIT_MACROS to fix C++ builds X-Git-Tag: v2.5.0-rc1~180 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=73e0d9449ffd250dfe241737a962758674b6b1aa;p=lttng-tools.git Fix: Define __STDC_LIMIT_MACROS to fix C++ builds 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 --- 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 */