From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeremie.galarneau@efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 10 Feb 2014 11:05:07 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds In-Reply-To: <2121067902.21017.1391874228506.JavaMail.zimbra@efficios.com> References: <1391815941-30337-1-git-send-email-jeremie.galarneau@efficios.com> <2121067902.21017.1391874228506.JavaMail.zimbra@efficios.com> Message-ID: On Sat, Feb 8, 2014 at 10:43 AM, Mathieu Desnoyers wrote: > ----- Original Message ----- >> From: "J?r?mie Galarneau" >> To: lttng-dev at lists.lttng.org >> Sent: Friday, February 7, 2014 6:32:21 PM >> Subject: [lttng-dev] [PATCH lttng-tools] 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. >> >> Signed-off-by: J?r?mie Galarneau >> --- >> include/lttng/lttng.h | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h >> index 18dec2a..2d410fa 100644 >> --- a/include/lttng/lttng.h >> +++ b/include/lttng/lttng.h >> @@ -23,7 +23,13 @@ >> #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. >> + */ >> +#define __STDC_LIMIT_MACROS >> #include >> +#undef __STDC_LIMIT_MACROS > > This has a side-effect: it undefines the __STDC_LIMIT_MACROS if it was > defined prior to including this header. It should be: Good point! Resubmitting as v2. Regards, J?r?mie > > #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 */ > > Thanks, > > Mathieu > >> #include >> >> /* Error codes that can be returned by API calls */ >> -- >> 1.8.5.2 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com