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.3.2~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1a447d12098fd1ce2d3fd2946cf225039c583b5f;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 4ffffd84f..a918ff2f2 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 */