external: igt-gpu-tools: support to compile with c++
Bug: 268289254
Test: build success
Change-Id: I58ee5ea2a9b6e6ac505b86a5bff00d5d7673885b
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 614f57e..e34fa76 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -38,6 +38,10 @@
#include "igt_core.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* NOTE: Theser are _only_ for testcases exercising driver specific rendering
* ioctls and uapi (and a bunch of historical reasons). And KMS testcase should
@@ -132,4 +136,8 @@
errno = 0; \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* DRMTEST_H */
diff --git a/lib/igt_core.h b/lib/igt_core.h
index f3ef01d..1e770f6 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -42,6 +42,10 @@
#include <getopt.h>
#include <unistd.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef IGT_LOG_DOMAIN
#define IGT_LOG_DOMAIN (NULL)
#endif
@@ -1218,4 +1222,8 @@
#define USEC_PER_SEC (1000*MSEC_PER_SEC)
#define NSEC_PER_SEC (1000*USEC_PER_SEC)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* IGT_CORE_H */
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 7290b69..6943caa 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -45,6 +45,10 @@
#define USE_VC4
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Internal format to denote a buffer compatible with pixman's
* floating point format. Range [0-1].
@@ -208,5 +212,9 @@
void igt_format_array_fill(uint32_t **formats_array, unsigned int *count,
bool allow_yuv);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __IGT_FB_H__ */
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index d4e6510..23c617a 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -38,6 +38,10 @@
#include "igt_fb.h"
#include "ioctl_wrappers.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Low-level helpers with kmstest_ prefix */
/**
@@ -843,4 +847,8 @@
return igt_vblank_after(b, a);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __IGT_KMS_H__ */
diff --git a/lib/igt_stats.h b/lib/igt_stats.h
index 5faeced..f0f18fd 100644
--- a/lib/igt_stats.h
+++ b/lib/igt_stats.h
@@ -29,6 +29,10 @@
#include <stdbool.h>
#include <math.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* igt_stats_t:
* @values_u64: An array containing pushed integer values
@@ -100,4 +104,8 @@
double igt_mean_get(struct igt_mean *m);
double igt_mean_get_variance(struct igt_mean *m);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __IGT_STATS_H__ */