Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 10 Feb 2014 16:04:22 +0000 (11:04 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 11 Feb 2014 21:49:37 +0000 (16:49 -0500)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
include/lttng/lttng.h

index 18dec2a8acfbf4da2eb07a63bb3174107f4a5509..f0be224b53c1b2343c2e34961bf7a5f18dd3982c 100644 (file)
 #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 */
This page took 0.026974 seconds and 5 git commands to generate.