Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-tools] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
@ 2014-02-07 23:32 Jérémie Galarneau
  2014-02-08 15:43 ` Mathieu Desnoyers
  0 siblings, 1 reply; 6+ messages in thread
From: Jérémie Galarneau @ 2014-02-07 23:32 UTC (permalink / raw)


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 | 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 <limits.h>
+/*
+ * 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 <stdint.h>
+#undef __STDC_LIMIT_MACROS
 #include <sys/types.h>
 
 /* Error codes that can be returned by API calls */
-- 
1.8.5.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lttng-dev] [PATCH lttng-tools] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
  2014-02-07 23:32 [lttng-dev] [PATCH lttng-tools] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds Jérémie Galarneau
@ 2014-02-08 15:43 ` Mathieu Desnoyers
  2014-02-10 16:04   ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
  2014-02-10 16:05   ` [lttng-dev] [PATCH lttng-tools] " Jérémie Galarneau
  0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Desnoyers @ 2014-02-08 15:43 UTC (permalink / raw)


----- Original Message -----
> From: "J?r?mie Galarneau" <jeremie.galarneau@efficios.com>
> 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 <jeremie.galarneau at efficios.com>
> ---
>  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 <limits.h>
> +/*
> + * 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 <stdint.h>
> +#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:

#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 */

Thanks,

Mathieu

>  #include <sys/types.h>
>  
>  /* 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lttng-dev] [PATCH lttng-tools v2] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
  2014-02-08 15:43 ` Mathieu Desnoyers
@ 2014-02-10 16:04   ` Jérémie Galarneau
  2014-02-10 17:55     ` Mathieu Desnoyers
  2014-02-11 21:50     ` David Goulet
  2014-02-10 16:05   ` [lttng-dev] [PATCH lttng-tools] " Jérémie Galarneau
  1 sibling, 2 replies; 6+ messages in thread
From: Jérémie Galarneau @ 2014-02-10 16:04 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lttng-dev] [PATCH lttng-tools] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
  2014-02-08 15:43 ` Mathieu Desnoyers
  2014-02-10 16:04   ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
@ 2014-02-10 16:05   ` Jérémie Galarneau
  1 sibling, 0 replies; 6+ messages in thread
From: Jérémie Galarneau @ 2014-02-10 16:05 UTC (permalink / raw)


On Sat, Feb 8, 2014 at 10:43 AM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> ----- Original Message -----
>> From: "J?r?mie Galarneau" <jeremie.galarneau@efficios.com>
>> 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 <jeremie.galarneau at efficios.com>
>> ---
>>  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 <limits.h>
>> +/*
>> + * 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 <stdint.h>
>> +#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 <stdint.h>
> #undef __STDC_LIMIT_MACROS
> #else /* #ifndef __STDC_LIMIT_MACROS */
> #include <stdint.h>
> #endif /* #else #ifndef __STDC_LIMIT_MACROS */
>
> Thanks,
>
> Mathieu
>
>>  #include <sys/types.h>
>>
>>  /* 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lttng-dev] [PATCH lttng-tools v2] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
  2014-02-10 16:04   ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
@ 2014-02-10 17:55     ` Mathieu Desnoyers
  2014-02-11 21:50     ` David Goulet
  1 sibling, 0 replies; 6+ messages in thread
From: Mathieu Desnoyers @ 2014-02-10 17:55 UTC (permalink / raw)


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

----- Original Message -----
> From: "J?r?mie Galarneau" <jeremie.galarneau@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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lttng-dev] [PATCH lttng-tools v2] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
  2014-02-10 16:04   ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
  2014-02-10 17:55     ` Mathieu Desnoyers
@ 2014-02-11 21:50     ` David Goulet
  1 sibling, 0 replies; 6+ messages in thread
From: David Goulet @ 2014-02-11 21:50 UTC (permalink / raw)


Merged!

Backported to stable-2.4 and 2.3

On 10 Feb (11:04:22), J?r?mie Galarneau wrote:
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140211/5ef2e37c/attachment.pgp>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-11 21:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 23:32 [lttng-dev] [PATCH lttng-tools] Fix: Define __STDC_LIMIT_MACROS to fix C++ builds Jérémie Galarneau
2014-02-08 15:43 ` Mathieu Desnoyers
2014-02-10 16:04   ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
2014-02-10 17:55     ` Mathieu Desnoyers
2014-02-11 21:50     ` David Goulet
2014-02-10 16:05   ` [lttng-dev] [PATCH lttng-tools] " Jérémie Galarneau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox