display: compilation fix in gralloc
if gr_priv_handle.h is accessed via C files, it throws error.
Added ifdef for cpluplus to fix this.
Change-Id: I16e593fb369205fefec76b05e9c6199b376d2f67
diff --git a/gralloc/gr_priv_handle.h b/gralloc/gr_priv_handle.h
index ace762e..0968c5c 100644
--- a/gralloc/gr_priv_handle.h
+++ b/gralloc/gr_priv_handle.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
* Not a Contribution
*
* Copyright (C) 2008 The Android Open Source Project
@@ -23,7 +23,9 @@
#include <log/log.h>
#include <hardware/gralloc.h>
#include <hardware/gralloc1.h>
+#ifdef __cplusplus
#include <cinttypes>
+#endif
#define GRALLOC1_FUNCTION_PERFORM 0x00001000
@@ -34,7 +36,12 @@
#define PRIV_HANDLE_CONST(exp) static_cast<const private_handle_t *>(exp)
#pragma pack(push, 4)
+#ifdef __cplusplus
struct private_handle_t : public native_handle_t {
+#else
+struct private_handle_t {
+ native_handle_t nativeHandle;
+#endif
enum {
PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
PRIV_FLAGS_USES_ION = 0x00000008,
@@ -85,7 +92,7 @@
uint64_t base;
uint64_t base_metadata;
uint64_t gpuaddr;
-
+#ifdef __cplusplus
static const int kNumFds = 2;
static const int kMagic = 'gmsm';
@@ -175,6 +182,7 @@
uint64_t GetUsage() const { return usage; }
uint64_t GetBackingstore() const { return id; }
+#endif
};
#pragma pack(pop)