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

Jérémie Galarneau jeremie.galarneau at efficios.com
Fri Feb 7 18:32:21 EST 2014


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




More information about the lttng-dev mailing list