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:50:00 +0000 (16:50 -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 4ffffd84ff237bedddbf1bbc27c325c32136b521..a918ff2f229230e6bbe9f3e583fbe3ef6810e9db 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.026341 seconds and 4 git commands to generate.