From b510ca676e50e603cb3a8b15ecee0bcb39cd8bfa Mon Sep 17 00:00:00 2001
From: Allan MacKinnon <allanmac@google.com>
Date: Mon, 13 May 2019 21:15:39 +0000
Subject: [PATCH] [graphics][compute] Properly export C functions for use in
 C++ (/color,/ts)

Tracked by SPN-19.

Testability: not yet part of build.
Change-Id: I04c73606b03191d2c6e4f2048f329af848c8f5fb
---
 src/graphics/lib/compute/color/color.c        |  8 ++------
 src/graphics/lib/compute/color/color.h        | 16 ++++++++++++++++
 src/graphics/lib/compute/ts/transform_stack.h | 16 ++++++++++++++++
 3 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/src/graphics/lib/compute/color/color.c b/src/graphics/lib/compute/color/color.c
index 6badfe31643..02278e37c4f 100644
--- a/src/graphics/lib/compute/color/color.c
+++ b/src/graphics/lib/compute/color/color.c
@@ -3,15 +3,11 @@
 // found in the LICENSE file.
 
 //
-//
+// COLOR UTILITIES
 //
 
-#include <math.h>
 #include "color.h"
-
-//
-// COLOR UTILITIES
-//
+#include <math.h>
 
 //
 // CONVERT FROM 0xAARRGGBB WORD ORDER INTO f32[4]
diff --git a/src/graphics/lib/compute/color/color.h b/src/graphics/lib/compute/color/color.h
index 0e24366afd0..10743b5b8c1 100644
--- a/src/graphics/lib/compute/color/color.h
+++ b/src/graphics/lib/compute/color/color.h
@@ -14,6 +14,14 @@
 
 #include <stdint.h>
 
+//
+//
+//
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 //
 // CONVERT FROM 0xAARRGGBB WORD ORDER INTO f32[4]
 //
@@ -63,3 +71,11 @@ void color_linear_lerp_rgba_f32(float       rgba_m[4],
 //
 //
 //
+
+#ifdef __cplusplus
+}
+#endif
+
+//
+//
+//
diff --git a/src/graphics/lib/compute/ts/transform_stack.h b/src/graphics/lib/compute/ts/transform_stack.h
index 2afa1ee5eba..949217e7ccb 100644
--- a/src/graphics/lib/compute/ts/transform_stack.h
+++ b/src/graphics/lib/compute/ts/transform_stack.h
@@ -18,6 +18,14 @@
 //
 //
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+//
+//
+
 struct ts_transform_stack;
 
 //
@@ -249,3 +257,11 @@ ts_transform_stack_multiply(struct ts_transform_stack * const ts);
 //
 //
 //
+
+#ifdef __cplusplus
+}
+#endif
+
+//
+//
+//
-- 
GitLab