Fix: Define __STDC_LIMIT_MACROS to fix C++ builds
[lttng-tools.git] / 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.023026 seconds and 4 git commands to generate.