[lttng-dev] [PATCH lttng-tools v2] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Feb 10 12:55:28 EST 2014


Acked-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

----- Original Message -----
> From: "Jérémie Galarneau" <jeremie.galarneau at efficios.com>
> To: lttng-dev at lists.lttng.org
> Sent: Monday, February 10, 2014 11:04:22 AM
> Subject: [lttng-dev] [PATCH lttng-tools v2] 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 <jeremie.galarneau at efficios.com>
> ---
>  include/lttng/lttng.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h
> index 18dec2a..f0be224 100644
> --- a/include/lttng/lttng.h
> +++ b/include/lttng/lttng.h
> @@ -23,7 +23,17 @@
>  #define LTTNG_H
>  
>  #include <limits.h>
> +/*
> + * 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 <stdint.h>
> +#undef __STDC_LIMIT_MACROS
> +#else /* #ifndef __STDC_LIMIT_MACROS */
>  #include <stdint.h>
> +#endif /* #else #ifndef __STDC_LIMIT_MACROS */
>  #include <sys/types.h>
>  
>  /* Error codes that can be returned by API calls */
> --
> 1.8.5.4
> 
> 
> _______________________________________________
> 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



More information about the lttng-dev mailing list